Advanced Psychological Levels with Dynamic Spacing═══════════════════════════════════════
 ADVANCED PSYCHOLOGICAL LEVELS WITH DYNAMIC SPACING 
═══════════════════════════════════════
A comprehensive psychological price level indicator that automatically identifies and displays round number levels across multiple timeframes. Features dynamic ATR-based spacing, smart crypto detection, distance tracking, and customizable alert system.
───────────────────────────────────────
 WHAT THIS INDICATOR DOES 
───────────────────────────────────────
This indicator automatically draws psychological price levels (round numbers) that often act as support and resistance:
- Dynamic ATR-Based Spacing - Adapts level spacing to market volatility
- Multiple Level Types - Major (250 pip), Standard (100 pip), Mid, and Intraday levels
- Smart Asset Detection - Automatically adjusts for Forex, Crypto, Indices, and CFDs
- Crypto Price Adaptation - Intelligent level spacing based on cryptocurrency price magnitude
- Distance Information Table - Real-time percentage distance to nearest levels
- Combined Level Labels - Clear identification when multiple level types coincide
- Performance Optimized - Configurable visible range and label limits
- Comprehensive Alerts - Notifications when price crosses any level type
───────────────────────────────────────
 HOW IT WORKS 
───────────────────────────────────────
 PSYCHOLOGICAL LEVELS CONCEPT: 
Psychological levels are round numbers where traders tend to place orders, creating natural support and resistance zones. These include:
- Forex: 1.0000, 1.0100, 1.0050 (pips)
- Crypto: $100, $1,000, $10,000 (whole numbers)
- Indices: 10,000, 10,500, 11,000 (points)
Why They Matter:
- Traders naturally gravitate to round numbers
- Stop losses cluster at these levels
- Take profit orders concentrate here
- Institutional algorithmic trading often targets these levels
 DYNAMIC ATR-BASED SPACING: 
Traditional Method:
- Fixed spacing regardless of volatility
- May be too tight in volatile markets
- May be too wide in quiet markets
Dynamic Method (Recommended):
- Uses ATR (Average True Range) to measure volatility
- Automatically adjusts level spacing
- Tighter levels in low volatility
- Wider levels in high volatility
Calculation:
1. Calculate ATR over specified period (default: 14)
2. Multiply by ATR multiplier (default: 2.0)
3. Round to nearest psychological level
4. Generate levels at dynamic intervals
Benefits:
- Adapts to market conditions
- More relevant levels in all volatility regimes
- Reduces clutter in trending markets
- Provides more detail in ranging markets
 LEVEL TYPES: 
Major Levels (250 pip/point):
- Highest significance
- Primary support/resistance zones
- Color: Red (default)
- Style: Solid lines
- Spacing: 2.5x standard step
Standard Levels (100 pip/point):
- Secondary importance
- Common psychological barriers
- Color: Blue (default)
- Style: Dashed lines
- Spacing: Standard step
Mid Levels (50% between major):
- Optional intermediate levels
- Halfway between major levels
- Color: Gray (default)
- Style: Dotted lines
- Usage: Additional confluence points
Intraday Levels (sub-100 pip):
- For intraday traders
- Fine-grained precision
- Color: Yellow (default)
- Style: Dotted lines
- Only shown on intraday timeframes
 SMART ASSET DETECTION: 
Forex Pairs:
- Detects major currency pairs automatically
- Uses pip-based calculations
- Standard: 100 pips (0.0100)
- Major: 250 pips (0.0250)
- Intraday: 20, 50, 80 pip subdivisions
Cryptocurrencies:
- Automatic price magnitude detection
- Adaptive spacing based on price:
  * Under $0.10: Levels at $0.01, $0.05
  * $0.10-$1: Levels at $0.10, $0.50
  * $1-$10: Levels at $1, $5
  * $10-$100: Levels at $10, $50
  * $100-$1,000: Levels at $100, $500
  * $1,000-$10,000: Levels at $1,000, $5,000
  * Over $10,000: Levels at $5,000, $10,000
Indices & CFDs:
- Fixed point-based system
- Major: 500 point intervals (with 250 sub-levels)
- Standard: 100 point intervals
- Suitable for stock indices like SPX, NASDAQ
 COMBINED LEVEL LABELS: 
When multiple level types coincide at the same price:
- Single line drawn (highest priority color)
- Combined label shows all types
- Priority: Major > Standard > Mid > Intraday
Example Label Formats:
- "1.1000 Major" - Major level only
- "1.1000 Std + Major" - Both standard and major
- "50000 Intra + Mid + Std" - Three levels coincide
Benefits:
- Cleaner chart appearance
- Clear identification of confluence
- Reduced visual clutter
- Easy to spot high-importance levels
 DISTANCE INFORMATION TABLE: 
Real-time tracking of nearest levels:
Table Contents:
- Nearest major level above (price and % distance)
- Nearest standard level above (price and % distance)
- Nearest standard level below (price and % distance)
Display:
- Top right corner (configurable)
- Color-coded by level type
- Real-time percentage calculations
- Helpful for position management
Usage:
- Identify proximity to key levels
- Set realistic profit targets
- Gauge potential move magnitude
- Monitor approaching resistance/support
ALERT SYSTEM:
Comprehensive crossing alerts:
Alert Types:
- Major Level Crosses
- Standard Level Crosses
- Intraday Level Crosses
Alert Modes:
- First Cross Only: Alert once when level is crossed
- All Crosses: Alert every time level is crossed
Alert Information:
- Level type crossed
- Specific price level
- Direction (above/below)
- One alert per bar to prevent spam
Configuration:
- Enable/disable by level type
- Choose alert frequency
- Customize for your trading style
───────────────────────────────────────
 HOW TO USE 
───────────────────────────────────────
 INITIAL SETUP: 
General Settings:
1. Enable "Use Dynamic ATR-Based Spacing" (recommended)
2. Set ATR Period (14 is standard)
3. Adjust ATR Multiplier (2.0 is balanced)
Visibility Settings:
1. Set Visible Range % (10% recommended for clarity)
2. Adjust Label Offset for readability
3. Configure performance limits if needed
Level Selection:
1. Enable/disable level types based on trading style
2. Adjust line counts for each type
3. Choose line styles and colors for visibility
 TRADING STRATEGIES: 
Breakout Trading:
1. Wait for price to approach major or standard level
2. Monitor for consolidation near level
3. Enter on confirmed break above/beyond level
4. Stop loss just beyond the broken level
5. Target: Next major or standard level
Rejection Trading:
1. Identify major psychological level
2. Wait for price to test the level
3. Look for rejection signals (wicks, bearish/bullish candles)
4. Enter in direction of rejection
5. Stop beyond the level
6. Target: Previous level or mid-level
Range Trading:
1. Identify range between two major levels
2. Buy at lower psychological level
3. Sell at upper psychological level
4. Use standard and mid-levels for position management
5. Exit if major level breaks with volume
Confluence Trading:
1. Look for combined levels (Std + Major)
2. These represent high-probability zones
3. Use as primary support/resistance
4. Increase position size at confluence
5. Expect stronger reactions at these levels
Session-Based Trading:
1. Note opening level at session start (Asian/London/NY)
2. Trade breakouts of major levels during high-volume sessions
3. London/NY sessions: More likely to break levels
4. Asian session: More likely to respect levels (range trading)
 RISK MANAGEMENT WITH PSYCHOLOGICAL LEVELS: 
Stop Loss Placement:
- Place stops just beyond psychological levels
- Add buffer (5-10 pips for forex)
- Avoid exact round numbers (stop hunting risk)
- Use previous major level as maximum stop
Take Profit Strategy:
- First target: Next standard level (partial profit)
- Second target: Next major level (remaining position)
- Trail stops to breakeven at first target
- Use distance table to calculate risk/reward
Position Sizing:
- Larger positions at major levels (higher probability)
- Smaller positions at intraday levels (lower probability)
- Scale in at standard levels between major levels
- Reduce size when multiple levels are close together
 TIMEFRAME CONSIDERATIONS: 
Higher Timeframes (4H, Daily, Weekly):
- Focus on Major and Standard levels only
- Disable Intraday and Mid levels
- Wider level spacing expected
- Use for swing trading and position trading
Lower Timeframes (5m, 15m, 1H):
- Enable all level types
- Use Intraday levels for precision
- Tighter level spacing acceptable
- Good for day trading and scalping
Multi-Timeframe Approach:
- Identify major levels on Daily/4H charts
- Refine entries using 15m/1H intraday levels
- Trade in direction of higher timeframe bias
- Use lower timeframe levels for position management
───────────────────────────────────────
 CONFIGURATION GUIDE 
───────────────────────────────────────
GENERAL SETTINGS:
Dynamic ATR-Based Spacing:
- Enabled: Recommended for most markets
- Disabled: Fixed psychological levels
- ATR Period: 14 (standard), 10 (responsive), 20 (smooth)
- ATR Multiplier: 1.0-5.0 (2.0 is balanced)
VISIBILITY SETTINGS:
Visible Range %:
- 5%: Very tight range, minimal clutter
- 10%: Balanced view (recommended)
- 20%: Wide range, more context
- 50%: Maximum range, all levels visible
Label Offset:
- 10-20 bars: Close to current price
- 30-50 bars: Moderate distance
- 50-100 bars: Far from price action
Performance Limits:
- Max Historical Bars: Reduce if indicator loads slowly
- Max Labels: Reduce for cleaner chart (20-30 recommended)
LEVEL CUSTOMIZATION:
Line Count:
- Lower (1-3): Cleaner chart, fewer levels
- Medium (4-6): Balanced view
- Higher (7-10): More context, busier chart
Line Styles:
- Solid: High importance, easy to see
- Dashed: Medium importance, clear but subtle
- Dotted: Low importance, minimal visual weight
Colors:
- Use contrasting colors for different level types
- Red/Blue/Yellow default works well
- Adjust based on chart background and personal preference
DISTANCE TABLE:
Position:
- Top Right: Doesn't interfere with price action
- Top Left: Good for right-side price scale
- Bottom positions: Less common but available
Colors:
- Default (white text, dark background) works for most charts
- Match your chart theme for consistency
- Ensure text is readable against background
ALERT CONFIGURATION:
Alert by Level Type:
- Major: Most important, fewer false signals
- Standard: Balance of frequency and importance
- Intraday: Many signals, best for active traders
Alert Frequency:
- First Cross Only: Cleaner, less noise (recommended for swing trading)
- All Crosses: Every touch, good for scalping
Alert Setup in TradingView:
1. Configure desired alert types in indicator settings
2. Right-click chart → Add Alert
3. Select this indicator
4. Choose "Any alert() function call"
5. Set delivery method (mobile, email, webhook)
───────────────────────────────────────
 ASSET-SPECIFIC TIPS 
───────────────────────────────────────
FOREX (EUR/USD, GBP/USD, etc.):
- Major levels at x.x000, x.x500
- Standard levels at x.xx00
- Intraday levels at 20/50/80 pips
- Most effective during London/NY sessions
- Watch for "figure" levels (1.0000, 1.1000)
CRYPTOCURRENCIES (BTC, ETH, etc.):
- Enable dynamic spacing for volatile markets
- Levels adjust automatically based on price
- Watch major $1,000 increments for BTC
- $100 levels important for ETH
- Smaller caps: Use standard levels
- High volatility: Increase ATR multiplier to 3.0
STOCK INDICES (SPX, NASDAQ, etc.):
- 100-point levels most important
- 500-point levels for major S/R
- 50-point mid-levels for refinement
- Watch end-of-day for level reactions
- Futures often lead spot on level breaks
GOLD/COMMODITIES:
- Major levels at $50 increments ($1,900, $1,950)
- Standard levels at $10 increments
- Very reactive to psychological levels
- Watch for false breaks during low volume
- Best reactions during active trading hours
───────────────────────────────────────
 BEST PRACTICES 
───────────────────────────────────────
Chart Setup:
- Use clean price action charts
- Avoid too many indicators
- Ensure psychological levels are clearly visible
- Match colors to your chart theme
Level Selection:
- Start with Major and Standard levels only
- Add Mid and Intraday as needed
- Less is more - avoid chart clutter
- Adjust based on timeframe
Combining with Other Tools:
- Volume profile for confluence
- Trendlines intersecting psychological levels
- Moving averages near round numbers
- Fibonacci levels coinciding with psychological levels
Common Mistakes to Avoid:
- Trading every level touch (be selective)
- Ignoring volume confirmation
- Setting stops exactly at levels (stop hunting)
- Forgetting to adjust for different assets
- Over-relying on levels without price action confirmation
Performance Optimization:
- Reduce visible range for faster loading
- Lower max historical bars on lower timeframes
- Limit labels to 30-50 for clarity
- Disable unused level types
───────────────────────────────────────
 EDUCATIONAL DISCLAIMER 
───────────────────────────────────────
This indicator identifies psychological price levels based on round numbers that tend to act as support and resistance. The methodology includes:
- Round number detection algorithms
- ATR-based dynamic spacing calculations
- Asset-specific level determination
- Distance percentage calculations
Psychological levels are a recognized concept in technical analysis, studied by traders and institutions. However, they do not guarantee price reactions and should be used as part of a comprehensive trading strategy including proper risk management, volume analysis, and price action confirmation.
───────────────────────────────────────
 USAGE DISCLAIMER 
───────────────────────────────────────
This tool is for educational and analytical purposes. Psychological levels can act as support or resistance but price reactions are not guaranteed. Dynamic spacing may generate different levels in different market conditions. Always conduct independent analysis, use proper risk management, and never risk capital you cannot afford to lose. Past performance does not indicate future results.
───────────────────────────────────────
 CREDITS & ATTRIBUTION 
───────────────────────────────────────
Original Concept: Sonar Lab
Cerca negli script per " TABLE"
Zero Lag Trend Signals (MTF) [Quant Trading] V7Overview 
The Zero Lag Trend Signals (MTF) V7 is a comprehensive trend-following strategy that combines Zero Lag Exponential Moving Average (ZLEMA) with volatility-based bands to identify high-probability trade entries and exits. This strategy is designed to reduce lag inherent in traditional moving averages while incorporating dynamic risk management through ATR-based stops and multiple exit mechanisms.
This is a longer term horizon strategy that takes limited trades. It is not a high frequency trading and therefore will also have limited data and not > 100 trades.
 How It Works 
 Core Signal Generation: 
The strategy uses a Zero Lag EMA (ZLEMA) calculated by applying an EMA to price data that has been adjusted for lag:
 
 Calculate lag period: floor((length - 1) / 2)
 Apply lag correction: src + (src - src )
 Calculate ZLEMA: EMA of lag-corrected price
 
Volatility bands are created using the highest ATR over a lookback period multiplied by a band multiplier. These bands are added to and subtracted from the ZLEMA line to create upper and lower boundaries.
 Trend Detection: 
The strategy maintains a trend variable that switches between bullish (1) and bearish (-1):
 
 Long Signal:  Triggers when price crosses above ZLEMA + volatility band
 Short Signal:  Triggers when price crosses below ZLEMA - volatility band
 
 Optional ZLEMA Trend Confirmation: 
When enabled, this filter requires ZLEMA to show directional momentum before entry:
 
 Bullish Confirmation:  ZLEMA must increase for 4 consecutive bars
 Bearish Confirmation:  ZLEMA must decrease for 4 consecutive bars
 
This additional filter helps avoid false signals in choppy or ranging markets.
 Risk Management Features: 
The strategy includes multiple stop-loss and take-profit mechanisms:
 
 Volatility-Based Stops:  Default stop-loss is placed at ZLEMA ± volatility band
 ATR-Based Stops:  Dynamic stop-loss calculated as entry price ± (ATR × multiplier)
 ATR Trailing Stop:  Ratcheting stop-loss that follows price but never moves against position
 Risk-Reward Profit Target:  Take-profit level set as a multiple of stop distance
 Break-Even Stop:  Moves stop to entry price after reaching specified R:R ratio
 Trend-Based Exit:  Closes position when price crosses EMA in opposite direction
 
 Performance Tracking: 
The strategy includes optional features for monitoring and analyzing trades:
 
 Floating Statistics Table:  Displays key metrics including win rate, GOA (Gain on Account), net P&L, and max drawdown
 Trade Log Labels:  Shows entry/exit prices, P&L, bars held, and exit reason for each closed trade
 CSV Export Fields:  Outputs trade data for external analysis
 
 Default Strategy Settings 
 Commission & Slippage: 
 
 Commission: 0.1% per trade
 Slippage: 3 ticks
 Initial Capital: $1,000
 Position Size: 100% of equity per trade
 
 Main Calculation Parameters: 
 
 Length: 70 (range: 70-7000) - Controls ZLEMA calculation period
 Band Multiplier: 1.2 - Adjusts width of volatility bands
 
 Entry Conditions (All Disabled by Default): 
 
 Use ZLEMA Trend Confirmation: OFF - Requires ZLEMA directional momentum
 Re-Enter on Long Trend: OFF - Allows multiple entries during sustained trends
 
 Short Trades: 
 
 Allow Short Trades: OFF - Strategy is long-only by default
 
 Performance Settings (All Disabled by Default): 
 
 Use Profit Target: OFF
 Profit Target Risk-Reward Ratio: 2.0 (when enabled)
 
 Dynamic TP/SL (All Disabled by Default): 
 
 Use ATR-Based Stop-Loss & Take-Profit: OFF
 ATR Length: 14
 Stop-Loss ATR Multiplier: 1.5
 Profit Target ATR Multiplier: 2.5
 Use ATR Trailing Stop: OFF
 Trailing Stop ATR Multiplier: 1.5
 Use Break-Even Stop-Loss: OFF
 Move SL to Break-Even After RR: 1.5
 Use Trend-Based Take Profit: OFF
 EMA Exit Length: 9
 
 Trade Data Display (All Disabled by Default): 
 
 Show Floating Stats Table: OFF
 Show Trade Log Labels: OFF
 Enable CSV Export: OFF
 Trade Label Vertical Offset: 0.5
 
 Backtesting Date Range: 
 
 Start Date: January 1, 2018
 End Date: December 31, 2069
 
 Important Usage Notes 
 
 Default Configuration:  The strategy operates in its most basic form with default settings - using only ZLEMA crossovers with volatility bands and volatility-based stop-losses. All advanced features must be manually enabled.
 Stop-Loss Priority:  If multiple stop-loss methods are enabled simultaneously, the strategy will use whichever condition is hit first. ATR-based stops override volatility-based stops when enabled.
 Long-Only by Default:  Short trading is disabled by default. Enable "Allow Short Trades" to trade both directions.
 Performance Monitoring:  Enable the floating stats table and trade log labels to visualize strategy performance during backtesting.
 Exit Mechanisms:  The strategy can exit trades through multiple methods: stop-loss hit, take-profit reached, trend reversal, or trailing stop activation. The trade log identifies which exit method was used.
 Re-Entry Logic:  When "Re-Enter on Long Trend" is enabled with ZLEMA trend confirmation, the strategy can take multiple long positions during extended uptrends as long as all entry conditions remain valid.
 Capital Efficiency:  Default setting uses 100% of equity per trade. Adjust "default_qty_value" to manage position sizing based on risk tolerance.
 Realistic Backtesting:  Strategy includes commission (0.1%) and slippage (3 ticks) to provide realistic performance expectations. These values should be adjusted based on your broker and market conditions.
 
 Recommended Use Cases 
 
 Trending Markets:  Best suited for markets with clear directional moves where trend-following strategies excel
 Medium to Long-Term Trading:  The default length of 70 makes this strategy more appropriate for swing trading rather than scalping
 Risk-Conscious Traders:  Multiple stop-loss options allow traders to customize risk management to their comfort level
 Backtesting & Optimization:  Comprehensive performance tracking features make this strategy ideal for testing different parameter combinations
 
 Limitations & Considerations 
 
 Like all trend-following strategies, performance may suffer in choppy or ranging markets
 Default 100% position sizing means full capital exposure per trade - consider reducing for conservative risk management
 Higher length values (70+) reduce signal frequency but may improve signal quality
 Multiple simultaneous risk management features may create conflicting exit signals
 Past performance shown in backtests does not guarantee future results
 
 Customization Tips 
For more aggressive trading:
 
 Reduce length parameter (minimum 70)
 Decrease band multiplier for tighter bands
 Enable short trades
 Use lower profit target R:R ratios
 
For more conservative trading:
 
 Increase length parameter
 Enable ZLEMA trend confirmation
 Use wider ATR stop-loss multipliers
 Enable break-even stop-loss
 Reduce position size from 100% default
 
For optimal choppy market performance:
 
 Enable ZLEMA trend confirmation
 Increase band multiplier
 Use tighter profit targets
 Avoid re-entry on trend continuation
 
 Visual Elements 
The strategy plots several elements on the chart:
 
 ZLEMA line (color-coded by trend direction)
 Upper and lower volatility bands
 Long entry markers (green triangles)
 Short entry markers (red triangles, when enabled)
 Stop-loss levels (when positions are open)
 Take-profit levels (when enabled and positions are open)
 Trailing stop lines (when enabled and positions are open)
 Optional ZLEMA trend markers (triangles at highs/lows)
 Optional trade log labels showing complete trade information
 
 Exit Reason Codes (for CSV Export) 
When CSV export is enabled, exit reasons are coded as:
 
 0 = Manual/Other
 1 = Trailing Stop-Loss
 2 = Profit Target
 3 = ATR Stop-Loss
 4 = Trend Change
 
 Conclusion 
Zero Lag Trend Signals V7 provides a robust framework for trend-following with extensive customization options. The strategy balances simplicity in its core logic with sophisticated risk management features, making it suitable for both beginner and advanced traders. By reducing moving average lag while incorporating volatility-based signals, it aims to capture trends earlier while managing risk through multiple configurable exit mechanisms.
The modular design allows traders to start with basic trend-following and progressively add complexity through ZLEMA confirmation, multiple stop-loss methods, and advanced exit strategies. Comprehensive performance tracking and export capabilities make this strategy an excellent tool for systematic testing and optimization.
 Note: This strategy is provided for educational and backtesting purposes. All trading involves risk. Past performance does not guarantee future results. Always test thoroughly with paper trading before risking real capital, and adjust position sizing and risk parameters according to your risk tolerance and account size. 
================================================================================
 TAGS: 
================================================================================
trend following, ZLEMA, zero lag, volatility bands, ATR stops, risk management, swing trading, momentum, trend confirmation, backtesting
================================================================================
 CATEGORY: 
================================================================================
Strategies
================================================================================
 CHART SETUP RECOMMENDATIONS: 
================================================================================
For optimal visualization when publishing:
 
 Use a clean chart with no other indicators overlaid
 Select a timeframe that shows multiple trade signals (4H or Daily recommended)
 Choose a trending asset (crypto, forex major pairs, or trending stocks work well)
 Show at least 6-12 months of data to demonstrate strategy across different market conditions
 Enable the floating stats table to display key performance metrics
 Ensure all indicator lines (ZLEMA, bands, stops) are clearly visible
 Use the default chart type (candlesticks) - avoid Heikin Ashi, Renko, etc.
 Make sure symbol information and timeframe are clearly visible
 
================================================================================
 COMPLIANCE NOTES: 
================================================================================
✅ Open-source publication with complete code visibility
✅ English-only title and description
✅ Detailed explanation of methodology and calculations
✅ Realistic commission (0.1%) and slippage (3 ticks) included
✅ All default parameters clearly documented
✅ Performance limitations and risks disclosed
✅ No unrealistic claims about performance
✅ No guaranteed results promised
✅ Appropriate for public library (original trend-following implementation with ZLEMA)
✅ Educational disclaimers included
✅ All features explained in detail
================================================================================
Crypto Perp Calc v1Advanced Perpetual Position Calculator for TradingView
 
 Description 
A comprehensive position sizing and risk management tool designed specifically for perpetual futures trading. This indicator eliminates the confusion of calculating leveraged positions by providing real-time position metrics directly on your chart.
 Key Features: 
 
 Interactive Price Selection:  Click directly on chart to set entry, stop loss, and take profit levels
 Accurate Lot Size Calculation:  Instantly calculates the exact position size needed for your margin and leverage
 Multiple Entry Support:  DCA into positions with up to 3 entry points with customizable allocation
 Multiple Take Profit Levels:  Scale out of positions with up to 3 TP targets
 Comprehensive Risk Metrics:  Shows dollar P&L, account risk percentage, and liquidation price
 Visual Risk/Reward:  Color-coded boxes and lines display your trade setup clearly
 Real-time Info Table:  All critical position data in one organized panel
 
Perfect for traders using perpetual futures who need precise position sizing with leverage.
---------
 How to Use
Quick Start (3 Clicks) 
1. Add the indicator to your chart
2. Click three times when prompted:
 
 First click:  Set your entry price
 Second click:  Set your stop loss
 Third click:  Set your take profit
 
3. Read the TOTAL LOTS value from the info table (highlighted in yellow)
4. Use this lot size in your exchange when placing the trade
 Detailed Setup 
 Step 1:  Configure Your Account
 
 Enter your account balance (total USDT in account)
 Set your margin amount (how much USDT to risk on this trade)
 Choose your leverage (1x to 125x)
 Select Long or Short position
 
 Step 2: Set Price Levels
 
 
 Main levels use interactive clicking (Entry, SL, TP)
 For multiple entries or TPs, use the settings panel to manually input prices and percentages
 
 Step 3: Read the Results
 The info table shows:
 
 TOTAL LOTS - The position size to enter on your exchange
 Margin Used - Your actual capital at risk
 Notional - Total position value (margin × leverage)
 Max Risk - Dollar amount you'll lose at stop loss
 Total Profit - Dollar amount you'll gain at take profit
 R:R Ratio - Risk to reward ratio
 Account Risk - Percentage of account at risk
 Liquidation - Price where position gets liquidated
 
 Step 4: Advanced Features (Optional) 
 Multiple Entries (DCA):
 
 Enable "Use Multiple Entries"
 Set up to 3 entry prices
 Allocate percentage for each (must total 100%)
 See individual lot sizes for each entry
 
 Multiple Take Profits:
 
 
 Enable "Use Multiple TPs"
 Set up to 3 TP levels
 Allocate percentage to close at each level (must total 100%)
 View profit at each target
 
 Visual Elements 
 
 Blue lines/labels: Entry points
 Red lines/labels: Stop loss
 Green lines/labels: Take profit targets
 Colored boxes: Visual risk (red) and reward (green) zones
 Info table: Can be positioned anywhere on screen
 
 Alerts 
 Set price alerts for: 
 
 Entry zones reached
 Stop loss approached
 Take profit levels hit
 Works with TradingView's alert system
 
 Tips for Best Results
 
 
 Always verify the lot size matches your intended risk
 Check the liquidation price stays far from your stop loss
 Monitor the account risk percentage (recommended: keep under 2-3%)
 Use the warning indicators if risk exceeds margin
 For quick trades, use single entry/TP; for complex strategies, use multiple levels
 
 Example Workflow
 
 
 Find your trade setup using your analysis
 Add this indicator and click to set levels
 Check risk metrics in the table
 Copy the TOTAL LOTS value
 Enter this exact position size on your exchange
 Set alerts for key levels if desired
 
This tool bridges the gap between TradingView charting and exchange execution, ensuring your position sizing is always accurate when trading with leverage.
 Disclaimer, this was coded with help of AI, double check calculations if they are off. 
cd_SMT_Sweep_CISD_CxGeneral 
This indicator is designed to show trading opportunities after sweeps of higher timeframe (HTF) highs/lows and, if available, Smart Money Technique (SMT) divergence with a correlated asset, followed by confirmation from a lower timeframe change in state delivery (CISD).
Users can track SMT, Sweep, and CISD levels across nine different timeframes.
________________________________________
 Usage and Details 
Commonly correlated timeframes are available in the menu by default. Users can also enter other compatible timeframes manually if necessary.
  
The indicator output is presented as:
•	A summary table
•	Display on HTF candles
•	CISD levels shown as lines
Users can disable any of these from the menu.
Presentations of selected timeframes are displayed only if they are greater than or equal to the active chart timeframe.
From the Show/Hide section, you can control the display of:
•	SMT table
•	Sweep table
•	HTF candles
•	CISD levels
•	HTF boxes aligned with the active timeframe
________________________________________
 SMT Analysis 
To receive analysis, users must enter correlated assets in the menu (or adjust them as needed).
If asset X is paired with correlated asset Y, then a separate entry for Y correlated with X is not required.
Four correlation pairs are included by default. Users should check them according to their broker/exchange or define new ones.
Checkboxes at the beginning of each row allow activation/deactivation of pairs.
  
SMT analysis is performed on the last three candles of each selected HTF.
If one asset makes a new high while the correlated one does not (or one makes a new low while the other does not), this is considered SMT and will be displayed both in the table and on the chart.
Charts without defined correlated assets will not display an SMT table.
________________________________________
 Sweep Analysis 
For the selected timeframes, the current candle is compared with the previous one.
If price violates the previous level and then pulls back behind it, this is considered a sweep. It is displayed in both the table and on the chart.
Within correlated pairs, the analysis is done separately and shown only in the table.
Example with correlated and non-correlated pairs:
  
•	In the table, X = false, ✓ = true.
•	The Sweep Table has two columns for Bullish and Bearish results.
•	For correlated pairs, both values appear side by side.
•	For undefined pairs, only the active asset is shown.
Example 1: EURUSD and GBPUSD pair
•	If both sweep → ✓ ✓
•	If one sweeps, the other does not → ✓ X
•	If neither sweeps → X X
Example 2: AUDUSD with no correlated pair defined
•	If sweep → ✓
•	If no sweep → X
________________________________________
 HTF Candles 
For every HTF enabled by the user, the last three candles (including the current one) are shown on the chart.
SMT and sweep signals are marked where applicable.
________________________________________
 CISD Levels 
For the selected timeframes, bullish and bearish CISD levels are plotted on the chart.
________________________________________
 HTF Boxes 
HTF boxes aligned with the active timeframe are displayed on the chart.
Box border colors change according to whether the active HTF candle is bullish or bearish.
________________________________________
 How to Read the Chart? 
Let’s break down the example below:
  
•	Active asset: Nasdaq
•	Correlated asset: US500 (defined in the menu, confirmed in the table bottom row)
•	Active timeframe: H1 → therefore, the HTF box is shown for Daily
•	Since a correlated pair is defined, the indicator runs both SMT and Sweep analysis for the selected timeframes. Without correlation, only Sweep analysis would be shown.
Table is prepared for H1 and higher timeframes (as per user selection and active TF).
Observations:
•	SMT side → H1 timeframe shows a bearish warning
•	Sweep side → Bearish column shows X and ✓
o	X → no sweep on Nasdaq
o	✓ → sweep on US500
Meaning: US500 made a new high (+ sweep) while Nasdaq did not → SMT formed.
The last column of the table shows the compatible LTF for confirmation.
For H1, it suggests checking the 5m timeframe.
On the chart:
•	CISD levels for selected timeframes are drawn
•	SMT line is marked on H1 candles
•	Next step: move to 5m chart for CISD confirmation before trading (with other confluences).
Similarly, the Daily row in the table shows a Bullish Sweep on US500.
________________________________________
 Alerts 
Two alert options are available:
 1. 	Activate Alert (SMT + Sweep):
Triggers if both SMT and Sweep occur in the selected timeframes. (Classic option)
 2. 	Activate Alert (Sweep + Sweep):
Triggers if sweeps occur in both assets of a correlated pair at the same timeframe.
Interpretation:
If SMT + Sweep are already present on higher timeframes, and simultaneous sweeps appear on lower timeframes, this may indicate a strong directional move.
Of course, this must be validated with CISD and other confluences.
________________________________________
 HTF CISD Levels 
Although CISD levels act as confirmation levels in their own timeframe, observing how price reacts to HTF CISD levels can provide valuable insights for intraday analysis.
POIs overlapping with these levels may be higher priority.
________________________________________
 What’s Next in Future Versions? 
•	Completed CISD confirmations
•	Additional alert options
•	Plus your feedback and suggestions
________________________________________
 Final Note 
I’ll be happy to hear your opinions and feedback.
Happy trading! 
Relative Strength Heat [InvestorUnknown]The Relative Strength Heat (RSH) indicator is a relative strength of an asset across multiple RSI periods through a dynamic heatmap and provides smoothed signals for overbought and oversold conditions. The indicator is highly customizable, allowing traders to adjust RSI periods, smoothing methods, and visual settings to suit their trading strategies.
The RSH indicator is particularly useful for identifying momentum shifts and potential reversal points by aggregating RSI data across a range of periods. It presents this data in a visually intuitive heatmap, with color-coded bands indicating overbought (red), oversold (green), or neutral (gray) conditions. Additionally, it includes signal lines for overbought and oversold indices, which can be smoothed using RAW, SMA, or EMA methods, and a table displaying the current index values.
  
 Features 
 
 Dynamic RSI Periods: Calculates RSI across 31 periods, starting from a user-defined base period and incrementing by a specified step.
 Heatmap Visualization: Displays RSI strength as a color-coded heatmap, with red for overbought, green for oversold, and gray for neutral zones.
 Customizable Smoothing: Offers RAW, SMA, or EMA smoothing for overbought and oversold signals.
 Signal Lines: Plots scaled overbought (purple) and oversold (yellow) signal lines with a midline for reference.
 Information Table: Displays real-time overbought and oversold index values in a table at the top-right of the chart.
 User-Friendly Inputs: Allows customization of RSI source, period ranges, smoothing length, and colors.
 
 How It Works 
The RSH indicator aggregates RSI calculations across 31 periods, starting from the user-defined Starting Period and incrementing by the Period Increment. For each period, it computes the RSI and determines whether the asset is overbought (RSI > threshold_ob) or oversold (RSI < threshold_os). These states are stored in arrays (ob_array for overbought, os_array for oversold) and used to generate the following outputs:
 Heatmap:  The indicator plots 31 horizontal bands, each representing an RSI period. The color of each band is determined by the f_col function:
Red if the RSI for that period is overbought (>threshold_ob).
Green if the RSI is oversold (
Straddle Charts - Live (Enhanced)Track options straddles with ease using the Straddle Charts - Live (Enhanced) indicator! Originally inspired by @mudraminer, this Pine Script v5 tool visualizes live call, put, and straddle prices for instruments like BANKNIFTY. Plotting call (green), put (red), and straddle (black) prices in a separate pane, it offers real-time insights for straddle strategy traders.
Key Features:
Live Data: Fetches 1-minute (customizable) option prices with error handling for invalid symbols.
Price Table: Displays call, put, straddle prices, and percentage change in a top-left table.
Volatility Alerts: Highlights bars with straddle price changes above a user-defined threshold (default 5%) with a yellow background and concise % labels.
Robust Design: Prevents plot errors with na checks and provides clear error messages.
How to Use: Input your call/put option symbols (e.g., NSE:NIFTY250814C24700), set the timeframe, and adjust the volatility threshold. Monitor straddle costs and volatility for informed trading decisions.
Perfect for options traders seeking a simple, reliable tool to track straddle performance. Check it out and share your feedback!
Floor and Roof Indicator with SignalsFloor and Roof Indicator with Trading Signals
A comprehensive support and resistance indicator that identifies premium and discount zones with automated signal generation.
Key Features:
Dynamic Support/Resistance Zones: Calculates floor (support) and roof (resistance) levels using price action and volatility
Premium/Discount Zone Identification: Highlights areas where price may find resistance or support
Customizable Signal Frequency: Control how often signals are displayed (every Nth occurrence)
Visual Signal Table: Optional table showing the last 5 long and short signal prices
Multiple Timeframe Compatibility: Works across all timeframes
Technical Details:
Uses ATR-based calculations for dynamic zone width adjustment
Combines Bollinger Bands with highest/lowest price analysis
Smoothing options for cleaner signal generation
Fully customizable colors and display options
How to Use:
Floor Zones (Blue): Potential support areas where long positions may be considered
Roof Zones (Pink): Potential resistance areas where short positions may be considered
Signal Crosses: Visual markers when price interacts with key levels
Signal Table: Track recent signal prices for analysis
Settings:
Length: Period for calculations (default: 200)
Smooth: Smoothing factor for cleaner signals
Zone Width: Adjust the thickness of support/resistance zones
Signal Frequency: Control signal display frequency
Visual Options: Customize colors and table position
Alerts Available:
Long signal alerts when price touches discount zones
Short signal alerts when price reaches premium zones
Educational Purpose: This indicator is designed to help traders identify potential support and resistance areas. Always combine with proper risk management and additional analysis.
This description focuses on the technical aspects and educational value while avoiding any language that could be interpreted as financial advice or guaranteed profits.
Money Risk Management with Trade Tracking
Overview 
The Money Risk Management with Trade Tracking indicator is a powerful tool designed for traders on TradingView to simplify trade simulation and risk management. Unlike the TradingView Strategy Tester, which can be complex for beginners, this indicator provides an intuitive, beginner-friendly interface to evaluate trading strategies in a realistic manner, mirroring real-world trading conditions.
Built on the foundation of open-source contributions from LuxAlgo and TCP, this indicator integrates external indicator signals, overlays take-profit (TP) and stop-loss (SL) levels, and provides detailed money management analytics. It empowers traders to visualize potential profits, losses, and risk-reward ratios, making it easier to understand the financial outcomes of their strategies.
 Key Features 
 
 Signal Integration:   Seamlessly integrates with external long and short signals from other indicators, allowing traders to overlay TP/SL levels based on their preferred strategies.
 Realistic Trade Simulation:  Simulates trades as they would occur in real-world scenarios, accounting for initial capital, risk percentage, leverage, and compounding effects.
 Money Management Dashboard:  Displays critical metrics such as current capital, unrealized P&L, risk amount, potential profit, risk-reward ratio, and trade status in a customizable, beginner-friendly table.
 TP/SL Visualization:  Plots TP and SL levels on the chart with customizable styles (solid, dashed, dotted) and colors, along with optional labels for clarity.
 Performance Tracking:  Tracks total trades, win/loss counts, win rate, and profit factor, providing a clear overview of strategy performance.
 Liquidation Risk Alerts:  Warns traders if stop-loss levels risk liquidation based on leverage settings, enhancing risk awareness.
 
 
 Benefits for Traders 
 
 Beginner-Friendly:  Simplifies the complexities of the TradingView Strategy Tester, offering an intuitive interface for new traders to simulate and evaluate trades without confusion.
 Real-World Insights:  Helps traders understand the actual profit or loss potential of their strategies by factoring in capital, risk, and leverage, bridging the gap between theoretical backtesting and real-world execution.
 Enhanced Decision-Making:  Provides clear, real-time analytics on risk-reward ratios, unrealized P&L, and trade performance, enabling informed trading decisions.
 Customizable and Flexible:  Allows customization of TP/SL settings, table positions, colors, and sizes, catering to individual trader preferences.
 Risk Management Focus:  Encourages disciplined trading by highlighting risk amounts, potential profits, and liquidation risks, fostering better financial planning.
 
 Why This Indicator Stands Out 
Many traders struggle to translate backtested strategy results into real-world outcomes due to the abstract nature of percentage-based profitability metrics. This indicator addresses that challenge by providing a practical, user-friendly tool that simulates trades with real-world parameters like capital, leverage, and compounding. Its open-source nature ensures accessibility, while its integration with other indicators makes it versatile for various trading styles.
 How to Use 
 
 Add to TradingView:  Copy the Pine Script code into TradingView’s Pine Editor and add it to your chart.
 Configure Inputs:  Set your initial capital, risk percentage, leverage, and TP/SL values in the indicator settings. Select external long/short signal sources if integrating with other indicators.
 Monitor Dashboards:  Use the Money Management and Target Dashboard tables to track trade performance and risk metrics in real time.
 Analyze Results:  Review win rates, profit factors, and P&L to refine your trading strategy.
 
 Credits 
 This indicator builds upon the open-source contributions of  LuxAlgo  and  TCP , whose efforts in sharing their code have made this tool possible. Their dedication to the trading community is deeply appreciated.
Canuck Trading IndicatorOverview
The Canuck Trading Indicator is a versatile, overlay-based technical analysis tool designed to assist traders in identifying potential trading opportunities across various timeframes and market conditions. By combining multiple technical indicators—such as RSI, Bollinger Bands, EMAs, VWAP, MACD, Stochastic RSI, ADX, HMA, and candlestick patterns—the indicator provides clear visual signals for bullish and bearish entries, breakouts, long-term trends, and options strategies like cash-secured puts, straddles/strangles, iron condors, and short squeezes. It also incorporates 20-day and 200-day SMAs to detect Golden/Death Crosses and price positioning relative to these moving averages. A dynamic table displays key metrics, and customizable alerts help traders stay informed of market conditions.
Key Features
Multi-Timeframe Adaptability: Automatically adjusts parameters (e.g., ATR multiplier, ADX period, HMA length) based on the chart's timeframe (minute, hourly, daily, weekly, monthly) for optimal performance.
Comprehensive Signal Generation: Identifies short-term entries, breakouts, long-term bullish trends, and options strategies using a combination of momentum, trend, volatility, and candlestick patterns.
Candlestick Pattern Detection: Recognizes bullish/bearish engulfing, hammer, shooting star, doji, and strong candles for precise entry/exit signals.
Moving Average Analysis: Plots 20-day and 200-day SMAs, detects Golden/Death Crosses, and evaluates price position relative to these averages.
Dynamic Table: Displays real-time metrics, including zone status (bullish, bearish, neutral), RSI, MACD, Stochastic RSI, short/long-term trends, candlestick patterns, ADX, ROC, VWAP slope, and MA positioning.
Customizable Alerts: Over 20 alert conditions for entries, exits, overbought/oversold warnings, and MA crosses, with actionable messages including ticker, price, and suggested strategies.
Visual Clarity: Uses distinct shapes, colors, and sizes to plot signals (e.g., green triangles for bullish entries, red triangles for bearish entries) and overlays key levels like EMA, VWAP, Bollinger Bands, support/resistance, and HMA.
Options Strategy Signals: Suggests opportunities for selling cash-secured puts, straddles/strangles, iron condors, and capitalizing on short squeezes.
How to Use
Add to Chart: Apply the indicator to any TradingView chart by selecting "Canuck Trading Indicator" from the Pine Script library.
Interpret Signals:
Bullish Signals: Green triangles (short-term entry), lime diamonds (breakout), blue circles (long-term entry).
Bearish Signals: Red triangles (short-term entry), maroon diamonds (breakout).
Options Strategies: Purple squares (cash-secured puts), yellow circles (straddles/strangles), orange crosses (iron condors), white arrows (short squeezes).
Exits: X-cross shapes in corresponding colors indicate exit signals.
Monitor: Gray circles suggest holding cash or monitoring for setups.
Review Table: Check the top-right table for real-time metrics, including zone status, RSI, MACD, trends, and MA positioning.
Set Alerts: Configure alerts for specific signals (e.g., "Short-Term Bullish Entry" or "Golden Cross") to receive notifications via TradingView.
Adjust Inputs: Customize input parameters (e.g., RSI period, EMA length, ATR period) to suit your trading style or market conditions.
Input Parameters
The indicator offers a wide range of customizable inputs to fine-tune its behavior:
RSI Period (default: 14): Length for RSI calculation.
RSI Bullish Low/High (default: 35/70): RSI thresholds for bullish signals.
RSI Bearish High (default: 65): RSI threshold for bearish signals.
EMA Period (default: 15): Main EMA length (15 for day trading, 50 for swing).
Short/Long EMA Length (default: 3/20): For momentum oscillator.
T3 Smoothing Length (default: 5): Smooths momentum signals.
Long-Term EMA/RSI Length (default: 20/15): For long-term trend analysis.
Support/Resistance Lookback (default: 5): Periods for support/resistance levels.
MACD Fast/Slow/Signal (default: 12/26/9): MACD parameters.
Bollinger Bands Period/StdDev (default: 15/2): BB settings.
Stochastic RSI Period/Smoothing (default: 14/3/3): Stochastic RSI settings.
Uptrend/Short-Term/Long-Term Lookback (default: 2/2/5): Candles for trend detection.
ATR Period (default: 14): For volatility and price targets.
VWAP Sensitivity (default: 0.1%): Threshold for VWAP-based signals.
Volume Oscillator Period (default: 14): For volume surge detection.
Pattern Detection Threshold (default: 0.3%): Sensitivity for candlestick patterns.
ROC Period (default: 3): Rate of change for momentum.
VWAP Slope Period (default: 5): For VWAP trend analysis.
TradingView Publishing Compliance
Originality: The Canuck Trading Indicator is an original script, combining multiple technical indicators and custom logic to provide unique trading signals. It does not replicate existing public scripts.
No Guaranteed Profits: This indicator is a tool for technical analysis and does not guarantee profits. Trading involves risks, and users should conduct their own research and risk management.
Clear Instructions: The description and usage guide are detailed and accessible, ensuring users understand how to apply the indicator effectively.
No External Dependencies: The script uses only built-in Pine Script functions (e.g., ta.rsi, ta.ema, ta.vwap) and requires no external libraries or data sources.
Performance: The script is optimized for performance, using efficient calculations and adaptive parameters to minimize lag on various timeframes.
Visual Clarity: Signals are plotted with distinct shapes and colors, and the table provides a concise summary of market conditions, enhancing usability.
Limitations and Risks
Market Conditions: The indicator may generate false signals in choppy or low-liquidity markets. Always confirm signals with additional analysis.
Timeframe Sensitivity: Performance varies by timeframe; test settings on your preferred chart (e.g., 5-minute for day trading, daily for swing trading).
Risk Management: Use stop-losses and position sizing to manage risk, as suggested in alert messages (e.g., "Stop -20%").
Options Trading: Options strategies (e.g., straddles, iron condors) carry unique risks; consult a financial advisor before trading.
Feedback and Support
For questions, suggestions, or bug reports, please leave a comment on the TradingView script page or contact the author via TradingView. Your feedback helps improve the indicator for the community.
Disclaimer
The Canuck Trading Indicator is provided for educational and informational purposes only. It is not financial advice. Trading involves significant risks, and past performance is not indicative of future results. Always perform your own due diligence and consult a qualified financial advisor before making trading decisions.
PowerHouse SwiftEdge AI v2.10 with Custom Filters & AI AnalysisPowerHouse SwiftEdge AI v2.10 with Custom Filters & AI Analysis
Overview
PowerHouse SwiftEdge AI v2.10 is an advanced TradingView Pine Script indicator designed to identify high-probability trading setups by combining pivot-based structure analysis, multi-timeframe trend detection, and adaptive AI-driven signal filtering. The script integrates Change of Character (CHoCH) and Break of Structure (BOS) signals with customizable momentum, volume, breakout, and trend filters to enhance trade precision. Additionally, it offers an optional AI Market Analysis module that predicts future price trends across multiple timeframes, providing traders with a comprehensive market outlook.
The script is highly customizable, allowing users to tailor inputs to their trading style, whether for scalping, swing trading, or long-term strategies. It is suitable for all asset classes, including stocks, forex, crypto, and commodities, and performs optimally on timeframes ranging from 1-minute to daily charts.
Key Features
Pivot-Based Signal Generation:
Identifies pivot highs and lows to detect CHoCH (reversal patterns) and BOS (continuation patterns).
Signals are plotted as "Buy" or "Sell" labels with optional "Get Ready" pre-signals to prepare traders for potential setups.
Take-profit (TP) levels are automatically calculated based on user-defined points, with optional TP box visualization.
Multi-Timeframe Trend Analysis:
Analyzes trends across seven timeframes (1M, 5M, 15M, 30M, 1H, 4H, D) using EMA and VWAP to determine bullish, bearish, or neutral conditions.
Displays a futuristic AI-Trend Matrix dashboard showing trend direction, strength, and confidence levels for quick decision-making.
Customizable Signal Filters:
Momentum Filter: Ensures signals align with significant price changes, adjusted dynamically using ATR-based volatility.
Higher Timeframe Trend Filter: Requires signals to align with the trend of a user-selected higher timeframe (e.g., 1H).
Lower Timeframe Trend Filter: Prevents signals that conflict with the trend of a user-selected lower timeframe (e.g., 5M).
Volume Filter: Optionally requires above-average volume to confirm signals.
Breakout Filter: Optionally requires price to break previous highs/lows for signal validation.
Repeated Signal Restriction: Prevents consecutive signals in the same trend direction until the trend changes on a user-defined timeframe.
AI-Driven Adaptivity:
Incorporates Cumulative Volume Delta (CVD) to assess buying/selling pressure and classify market volatility (Low, Medium, High).
Uses ATR to dynamically adjust momentum thresholds, ensuring signals adapt to current market conditions.
Optional AI Market Analysis module predicts trends across multiple timeframes by combining trend, momentum, and volatility scores.
Visual Elements:
Plots CHoCH and BOS levels as horizontal lines with distinct colors (aqua for CHoCH sell, lime for CHoCH buy, fuchsia for BOS sell, teal for BOS buy).
Draws dynamic support and resistance trendlines based on short and long-term price action, colored by trend strength.
Displays TP levels and pivot highs/lows for easy reference.
How It Works
The script combines several technical analysis concepts to create a robust trading system:
Market Structure Analysis:
Pivot highs and lows are identified using a user-defined lookback period (Pivot Length).
CHoCH occurs when price crosses below a pivot high (bearish reversal) or above a pivot low (bullish reversal).
BOS occurs when price breaks a previous pivot low (bearish continuation) or pivot high (bullish continuation).
Trend and Momentum Integration:
Trends are determined by comparing price to EMA and VWAP on multiple timeframes.
Momentum is calculated as the percentage price change, with thresholds adjusted by ATR to account for volatility.
"Get Ready" signals appear when momentum approaches the threshold, preparing traders for potential CHoCH or BOS signals.
Signal Filtering:
Filters ensure signals align with user-defined criteria (e.g., trend direction, volume, breakouts).
The Restrict Repeated Signals option prevents over-signaling by requiring a trend change on a specified timeframe before generating a new signal in the same direction.
AI Market Analysis:
The optional AI module calculates a score for each timeframe based on trend direction, momentum, and volatility (ATR compared to its SMA).
Scores are translated into predictions (▲ for bullish, ▼ for bearish, — for neutral), displayed in a dedicated table.
CVD and Volatility Context:
CVD tracks buying vs. selling pressure by accumulating volume based on price direction.
Volatility is classified using CVD magnitude, influencing the script’s visual cues and signal sensitivity.
Why This Combination?
The integration of pivot-based structure analysis, multi-timeframe trend filtering, and AI-driven adaptivity addresses common trading challenges:
Precision: CHoCH and BOS signals focus on key market turning points, reducing noise from minor price fluctuations.
Context: Multi-timeframe analysis ensures trades align with broader market trends, improving win rates.
Adaptivity: ATR and CVD adjustments make the script responsive to changing market conditions, avoiding static thresholds that fail in volatile or quiet markets.
Customization: Extensive input options allow traders to adapt the script to their preferred markets, timeframes, and risk profiles.
Predictive Insight: The AI Market Analysis module provides forward-looking trend predictions, helping traders anticipate market moves.
This combination creates a self-contained system that balances responsiveness with reliability, making it suitable for both novice and experienced traders.
How to Use
Add to Chart:
Apply the indicator to your TradingView chart for any asset and timeframe.
Recommended timeframes: 5M to 1H for scalping/day trading, 4H to D for swing trading.
Configure Inputs:
Pivot Length: Adjust (default 5) to control sensitivity to pivot highs/lows. Lower values for faster signals, higher for stronger confirmations.
Momentum Threshold: Set the minimum price change (default 0.01%) for signals. Increase for stricter conditions.
Take Profit Points: Define TP distance (default 10 points). Adjust based on asset volatility.
Signal Filters: Enable/disable filters (momentum, trend, volume, breakout) to match your strategy.
Higher/Lower Timeframe: Select timeframes for trend alignment (e.g., 1H for higher, 5M for lower).
AI Market Analysis: Enable for predictive trend insights across timeframes.
Get Ready Signals: Enable to see pre-signals for potential setups.
Interpret Signals:
Buy/Sell Labels: Act on green "Buy" or red "Sell" labels, confirming with TP levels and trend direction.
Get Ready Labels: Yellow "Get Ready BUY" or orange "Get Ready SELL" indicate potential setups; prepare but wait for confirmation.
CHoCH/BOS Lines: Use aqua/lime (CHoCH) and fuchsia/teal (BOS) lines as key support/resistance levels.
AI-Trend Matrix: Check the top-right dashboard for trend strength (%), confidence (%), and timeframe-specific trends.
AI Market Analysis Table: If enabled, view predictions (▲/▼/—) for each timeframe to anticipate market direction.
Trading Tips:
Combine signals with other indicators (e.g., RSI, MACD) for additional confirmation.
Use higher timeframe trend alignment for higher-probability trades.
Adjust TP and signal distance based on asset volatility and trading style.
Monitor the AI-Trend Matrix for trend strength; values above 50% or below -50% indicate strong directional bias.
Originality
PowerHouse SwiftEdge AI v2.10 stands out due to its unique blend of:
Adaptive Signal Generation: ATR-based momentum thresholds and CVD-driven volatility context ensure signals remain relevant across market conditions.
Multi-Timeframe Synergy: The script’s ability to filter signals based on both higher and lower timeframe trends provides a rare balance of precision and context.
AI-Powered Insights: The AI Market Analysis module offers predictive capabilities not commonly found in traditional indicators, simulating institutional-grade analysis.
Visual Clarity: The futuristic dashboard and color-coded trendlines make complex data accessible, enhancing usability for all trader levels.
Unlike standalone pivot or trend indicators, this script integrates multiple layers of analysis into a cohesive system, reducing false signals and providing actionable insights without requiring external tools or research.
Limitations
False Signals: No indicator is foolproof; signals may fail in choppy or low-volume markets. Use filters to mitigate.
Timeframe Sensitivity: Performance varies by timeframe and asset. Test settings thoroughly.
AI Predictions: The AI Market Analysis is based on historical data and simplified scoring; it’s not a guaranteed forecast.
Resource Usage: Enabling all filters and AI analysis may slow performance on lower-end devices.
regressionUtilitiesLibrary   "regressionUtilities" 
 get_linear_regression(bar_index_array, prices_array, stdDev_mult) 
  :                           Generates the linear regression channel for an array of values.
  Parameters:
     bar_index_array (array) : (array): Array with bar indexes
     prices_array (array) : (array):  Array with prices
     stdDev_mult (float) : (float):          Standard deviation multiple for the channels
  Returns: :                            Returns x1, x2, y1_mid, y2_mid, y1_up, y2_up, y1_dn, y2_dn, m, b, R2, stdDev
 get_optimal_linearRegression_channel(max_length, min_length, source, stdDev_mult, show_data_table, tableYpos, tableXpos, table_textSize, barsToRight, plot_labels, include_levels) 
  :                    Gets the best fitting linear regression using optimum length
  Parameters:
     max_length (int) : (int):         Maximum bar length
     min_length (int) : (int):         Minimum bar length
     source (float) : (float):           Source for the regression
     stdDev_mult (float) : (float):      Array with prices
     show_data_table (bool) : (bool):   Activates and shows the data table
     tableYpos (string) 
     tableXpos (string) 
     table_textSize (string) 
     barsToRight (int) 
     plot_labels (bool) 
     include_levels (bool) 
  Returns: :                        Returns three line objects that conform the regression channel, plus the optimal length and maximum r2
 get_regressionChannel_data(max_length, min_length, source, stdDev_mult, plot_linearRegression, plot_labels, include_levels, barsToRight) 
  : 							Gets data for the linear regression channel
  Parameters:
     max_length (int) : (int): 			Maximum length for the linear regression.
     min_length (int) : (int): 			Minimum length for the linear regression.
     source (float) : (float): 			    Source for the linear regression
     stdDev_mult (float) : (float): 		    Multiple for the standar deviations for the linear regression channel.
     plot_linearRegression (bool) 
     plot_labels (bool) 
     include_levels (bool) 
     barsToRight (int) 
  Returns: : 							Returns a maps with the regression levels, the direction flag and the datatable map.
 get_regressionChannel_data_v2(max_length, min_length, source, stdDev_mult, plot_linearRegression, plot_labels, include_levels, barsToRight) 
  Parameters:
     max_length (int) 
     min_length (int) 
     source (float) 
     stdDev_mult (float) 
     plot_linearRegression (bool) 
     plot_labels (bool) 
     include_levels (bool) 
     barsToRight (int) 
 get_cuadratic_regression(x_array, y_array, bars_to_project, max_length) 
  :                       Gets the best fitting linear regression using optimum length
  Parameters:
     x_array (array) : (array):     Maximum bar length
     y_array (array) : (array):   Minimum bar length
     bars_to_project (int) : (int):    Array with prices
     max_length (int) 
  Returns: :                        Returns three line objects
NFP High/Low Levels PlusNFP High/Low Levels Plus 
Description:
  This indicator stores the 12 most recent NFP (Non-Farm-Payroll) days and their values. 
  Values are captured from 0830 (NFP Release) until close of market
  
  The High and Low values for each NFP month are drawn on the chart with horizontal lines.
    - Labels indicating the month's high or low line are placed after the line
    - Optionally the high/low price can be displayed additionally
  
  Support and Resistance boxes can be drawn at the closest NFP level above and below the  
  current price.
    - Boxes will automatically update as prices cross the NFP value
  Macro Indicator
    - This option displays a small table in the top right corner that says "Up" or " Down"
    - The Macro Indicator can be used to judge the potential direction for the current month
    - Macro direction is calculated by the following:
       - UP: If two consecutive days both open and close above the most recent NFP High level
       - DOWN: If two consecutive days both open and close below the most recent NFP Low level
  Micro Indicator
    - This option displays a small table in the top right corner that says "Up" or " Down"
    - The Micro Indicator can be used to judge the potential direction for low timeframes 1H or 
      lower
    - Micro direction is calculated by the following:
       - UP: If two consecutive 10m candles close above the 20EMA
       - DOWN: If two consecutive 10m candles close below the 20EMA
  NFP Session Bars
    - This feature draws an arrow at the bottom of the chart for each candle that falls within the 
      NFP session day
    - This is useful for identifying NFP Days
  Support / Resistance Table
    - This displays a table bottom center showing the nearest high and low NFP line level
 What is an NFP Day and why is it useful to add to my chart? 
   - NFP Days are one of the most important data releases monthly
     - NFP (Non-Farm-Payroll) is the official release of 80% of the US workforce employed in 
       manufacturing, construction, and goods
     - It does not include those who work on farms, private households, non-profit and 
       government workers
   - Historically these high/low levels for the day create strong support and resistance levels
   - Having them displayed on the chart can help identify potential strong levels and pivot points
  
 Full Indicator with all options enabled and identified 
  
 Easily update NFP Release Days in the indicator settings 
  
 Modify various options: Show/Hide lines, labels, directional indicator tables, values tables
Adjust line width, offsets, colors, font sizes, box widths 
  
 Enable individual Directional Indicators and modify colors 
  
 Example of full indicator enabled 
You can find a list of the NFP Release Schedule on the  official  US Bureau of Labor Statistics website. This is useful for updating the indicator settings with the correct dates
Multi Asset & TF Stochastic
Multi Asset & TF Stochastic
This indicator allows you to compare the stochastic oscillator values of two different assets across multiple timeframes in a single pane. It’s designed for traders who want to analyse the momentum of one asset (by default, the chart’s asset) alongside a second asset of your choice (e.g., comparing EURUSD to the USD Index).
How It Works:
Main Asset:
The indicator automatically uses the chart’s asset for the primary stochastic calculation. You have the option to adjust the timeframe for this asset using a dropdown that includes TradingView’s standard timeframes, a "Chart" option (which automatically uses your chart’s timeframe), or a "Custom" option where you can type in any timeframe.
Second Asset:
You can enable the display of a second asset by toggling the “Display Second Asset” option. Choose the asset symbol (default is “DXY”) and select its timeframe from an identical dropdown. When enabled, the script calculates the stochastic oscillator for the second asset, allowing you to compare its momentum (%K and %D lines) with that of the main asset.
Stochastic Oscillator Settings:
Customize the %K length, the smoothing period for %K, and the smoothing period for %D. Both assets’ stochastic values are calculated using these parameters.
Visual Display:
The indicator plots the %K and %D lines for the main asset in prominent colours. If the second asset is enabled, its %K and %D lines are also plotted in different colours. Additionally, overbought (80) and oversold (20) levels are marked, with a midline at 50, making it easier to gauge market conditions at a glance.
%D line can be toggled off for a cleaner view if required:
Asset Information Table:
A table at the top-centre of the pane displays the active asset symbols—ensuring you always know which assets are being analysed.
How to Use:
Apply the Indicator:
Add the script to your chart. By default, it will use the chart’s current asset and timeframe for the primary stochastic oscillator.
Adjust the Main Asset Settings:
Use the “Main Asset Timeframe” dropdown to select a specific timeframe for the main asset or stick with the “Chart” option for automatic syncing with your current chart.
Enable and Configure the Second Asset (Optional):
Toggle on “Display Second Asset” if you wish to compare another asset. Select the desired symbol and adjust its timeframe using the provided dropdown. Choose “Custom” if you need a timeframe not listed by default.
Review the Plots and Table:
Observe the stochastic %K and %D lines for each asset. The overbought/oversold levels help indicate potential market turning points. Check the table at the top-centre to confirm the asset symbols being displayed.
This versatile tool is ideal for traders who rely on momentum analysis and need to quickly compare the stochastic signals of different markets or instruments. Enjoy seamless multi-asset analysis with complete control over your timeframe settings!
MTF RSI CandlesThis Pine Script indicator is designed to provide a visual representation of Relative Strength Index (RSI) values across multiple timeframes. It enhances traditional candlestick charts by color-coding candles based on RSI levels, offering a clearer picture of overbought, oversold, and sideways market conditions. Additionally, it displays a hoverable table with RSI values for multiple predefined timeframes.
 Key Features 
1. Candle Coloring Based on RSI Levels:
 
 Candles are color-coded based on predefined RSI ranges for easy interpretation of market conditions.
 RSI Levels:
 75-100: Strongest Overbought (Green)
 65-75: Stronger Overbought (Dark Green)
 55-65: Overbought (Teal)
 45-55: Sideways (Gray)
 35-45: Oversold (Light Red)
 25-35: Stronger Oversold (Dark Red)
 0-25: Strongest Oversold (Bright Red)
 
2. Multi-Timeframe RSI Table:
 
 Displays RSI values for the following timeframes:
 1 Min, 2 Min, 3 Min, 4 Min, 5 Min
 10 Min, 15 Min, 30 Min, 1 Hour, 1 Day, 1 Week
 Helps traders identify RSI trends across different time horizons.
 
3. Hoverable RSI Values:
 
 
 Displays the RSI value of any candle when hovering over it, providing additional insights for analysis.
 
 Inputs 
1. RSI Length:
 
 Default: 14
 Determines the calculation period for the RSI indicator.
 
2. RSI Levels:
 
 Configurable thresholds for RSI zones:
 75-100: Strongest Overbought
 65-75: Stronger Overbought
 55-65: Overbought
 45-55: Sideways
 35-45: Oversold
 25-35: Stronger Oversold
 0-25: Strongest Oversold
 
 How It Works: 
1. RSI Calculation:
 
 The RSI is calculated for the current timeframe using the input RSI Length.
 It is also computed for 11 additional predefined timeframes using request.security.
 
2. Candle Coloring:
 
 Candles are colored based on their RSI values and the specified RSI levels.
 
3. Hoverable RSI Values:
 
 Each candle displays its RSI value when hovered over, via a dynamically created label.
 Multi-Timeframe Table:
 
 
 
 A table at the bottom-left of the chart displays RSI values for all predefined timeframes, making it easy to compare trends.
 
 
 Usage: 
1. Trend Identification:
 
 Use candle colors to quickly assess market conditions (overbought, oversold, or sideways).
 
2. Timeframe Analysis:
 
 Compare RSI values across different timeframes to determine long-term and short-term momentum.
 
3. Signal Confirmation:
 
 Combine RSI signals with other indicators or patterns for higher-confidence trades.
 
 Best Practices 
 
 Use this indicator in conjunction with volume analysis, support/resistance levels, or trendline strategies for better results.
 Customize RSI levels and timeframes based on your trading strategy or market conditions.
 Limitations 
 RSI is a lagging indicator and may not always predict immediate market reversals.
 Multi-timeframe analysis can lead to conflicting signals; consider your trading horizon.
 
Line Break Chart StrategyHello All! 
We should not pass this year without a gift!
My last publication in 2024 is Complete Line Break Chart Strategy with many features!
What is Line Break Chart?
" Line Break is a Japanese chart style that disregards time intervals and only focuses on price movements, similar to the Kagi and Renko chart styles. Line Break charts form a series of up and down bars (referred to as lines). Up lines represent rising prices, and down lines represent falling prices. New confirmed lines only form on the chart when closing prices break the range covered by previous lines. Users can control the number of past lines used in the calculation via the "Number of Lines" input in the chart settings. The typical "Number of Lines" setting is 3, meaning the chart forms a new up line when the closing price is above the high prices of the last three lines, and it forms a new down line when the closing price is below the past three lines' low prices. If the current price is higher, it is an up line and if it is lower, it is a down line. If the current closing price is the same or the move in the opposite direction is not large enough to warrant a reversal, l then no new line is draw n" by Tradingview.  You can find it here 
Now let's start examining the features of the indicator:
By using Line break reversals it shows trend on the main chart.  You can create alert .
Moreover, you can decide which trade should be taken by using Risk Management in the indicator. You can set the " Maximum Risk " and then if the risk is more than you set then the trade is not taken. When trend changed it checks the distance between reversal level and open price and compare it with the Maximum Risk
 Breakout: 
It can find breakouts and shows on the chart.  You can create alert for breakouts 
It can show breakouts on the main chart:
 Flip-Flops: 
Upon looking at set of price break charts, the trader will notice that there are instances when uptrend blocks is followed by one reversal block, and then by a reversal to a series of uptrend blocks. The opposite is also possible: a series of downtrend blocks is followed by one reversal box and then by an immediate reversal to downtrend. This price action is called a " Flip-Flop ". This structure usually produces trend continuation signal. when we see this then we better use Buy/Sell stop order. lets see this on the chart:
 Temporal Sequence Table: 
Sequence frequency shows the frequency distribution of the number of sequential highs and the number of sequential lows that have been generated. This is quite important to the trader who is seeking to join a trend or put on a trade when the price break reverses into a new trend direction. For example, if the pattern over the past year has been that there never were more than nine consecutive high closes, it would make sense not to enter a position late into the sequence of new high closes.
also you can see market structure. I have tried to formalize it and show it under the table. so you can understand if it's choppy market.
 "Number of Lines"  has very important role. While using low time frames such seconds/minutes time frame you may want to choose higher number of lines such 5,6. ( this may minimize the risk of a whipsaw )
 Gaps feature: 
You can set Gaps on/off. if Gaps on then you can see how long it takes for each box
 Reversal and Continuation Probability: 
The script calculated Reversal level and Continuation probability of the trend by using Sequence frequency.
It also shows unconfirmed box and current closing price level:
Last but not least it has Overlay option for all items, and can show all items in the main chart!
 P.S. I added alerts :) 
 Wish you all a happy new year! 
 Enjoy! 
GL LineIntroduction 
The GL Line Indicator is a versatile tool designed to assist traders in identifying market trends by utilizing three different types of moving averages (EMA, SMA, VWMA) across multiple timeframes. This indicator provides a comprehensive view of market conditions, making it easier to spot potential trading opportunities.
 Features 
 
 Multiple Moving Average Types:
Choose between Exponential Moving Average (EMA), Simple Moving Average (SMA), and Volume Weighted Moving Average (VWMA) for more tailored analysis.
 Triple Timeframe Analysis:
Analyze trends across three different timeframes (Main, Secondary, Tertiary) to get a clearer picture of market direction.
 Configurable Parameters:
Customizable lengths for fast and slow-moving averages. Adjustable ATR length and multiplier to refine trend detection sensitivity.
 Visual Trend Indication:
Bullish and bearish trends are marked with color-coded lines and fills, enhancing visual clarity.
 Confluence Table:
Optional confluence table that shows trend direction across the selected timeframes, aiding in decision-making.
 
 How It Works 
 
 Main Trend Calculation:
Select the type of moving average and set the lengths for fast and slow MAs. The difference between these MAs, adjusted by the ATR multiplier, determines the trend direction.
 Secondary and Tertiary Trends:
Similar calculations are done for secondary and tertiary timeframes, providing a broader market overview.
 Trend Direction and Plotting:
The indicator plots the moving averages and fills the area between them with colors to denote bullish (green) and bearish (red) trends.
 
 How to Use 
 
 Select Moving Average Type:
Choose between EMA, SMA, or VWMA based on your trading strategy.
 Set Lengths and Multipliers:
Customize the lengths for the fast and slow-moving averages and adjust the ATR length and multiplier for better trend sensitivity.
 Analyze Trends:
Use the color-coded plots and fills to identify market trends and make informed trading decisions.
 Check Confluence Table:
Optionally display the confluence table to see trend directions across different timeframes.
 
 Disclaimer 
This indicator is designed to work best when the secondary and tertiary trends are set to higher timeframes than the chart's timeframe. Using higher timeframes for additional trends provides a broader market perspective and enhances the reliability of trend signals. 
Machine Learning: Optimal RSI [YinYangAlgorithms]This Indicator, will rate multiple different lengths of RSIs to determine which RSI to RSI MA cross produced the highest profit within the lookback span. This ‘Optimal RSI’ is then passed back, and if toggled will then be thrown into a Machine Learning calculation. You have the option to Filter RSI and RSI MA’s within the Machine Learning calculation. What this does is, only other Optimal RSI’s which are in the same bullish or bearish direction (is the RSI above or below the RSI MA) will be added to the calculation.
You can either (by default) use a Simple Average; which is essentially just a Mean of all the Optimal RSI’s with a length of Machine Learning. Or, you can opt to use a k-Nearest Neighbour (KNN) calculation which takes a Fast and Slow Speed. We essentially turn the Optimal RSI into a MA with different lengths and then compare the distance between the two within our KNN Function.
RSI may very well be one of the most used Indicators for identifying crucial Overbought and Oversold locations. Not only that but when it crosses its Moving Average (MA) line it may also indicate good locations to Buy and Sell. Many traders simply use the RSI with the standard length (14), however, does that mean this is the best length?
By using the length of the top performing RSI and then applying some Machine Learning logic to it, we hope to create what may be a more accurate, smooth, optimal, RSI.
 Tutorial: 
  
This is a pretty zoomed out Perspective of what the Indicator looks like with its default settings (except with Bollinger Bands and Signals disabled). If you look at the Tables above, you’ll notice, currently the Top Performing RSI Length is 13 with an Optimal Profit % of: 1.00054973. On its default settings, what it does is Scan X amount of RSI Lengths and checks for when the RSI and RSI MA cross each other. It then records the profitability of each cross to identify which length produced the overall highest crossing profitability. Whichever length produces the highest profit is then the RSI length that is used in the plots, until another length takes its place. This may result in what we deem to be the ‘Optimal RSI’ as it is an adaptive RSI which changes based on performance.
  
In our next example, we changed the ‘Optimal RSI Type’ from ‘All Crossings’ to ‘Extremity Crossings’. If you compare the last two examples to each other, you’ll notice some similarities, but overall they’re quite different. The reason why is, the Optimal RSI is calculated differently. When using ‘All Crossings’ everytime the RSI and RSI MA cross, we evaluate it for profit (short and long). However, with ‘Extremity Crossings’, we only evaluate it when the RSI crosses over the RSI MA and RSI <= 40 or RSI crosses under the RSI MA and RSI >= 60. We conclude the crossing when it crosses back on its opposite of the extremity, and that is how it finds its Optimal RSI.
The way we determine the Optimal RSI is crucial to calculating which length is currently optimal.
  
In this next example we have zoomed in a bit, and have the full default settings on. Now we have signals (which you can set alerts for), for when the RSI and RSI MA cross (green is bullish and red is bearish). We also have our Optimal RSI Bollinger Bands enabled here too. These bands allow you to see where there may be Support and Resistance within the RSI at levels that aren’t static; such as 30 and 70. The length the RSI Bollinger Bands use is the Optimal RSI Length, allowing it to likewise change in correlation to the Optimal RSI.
  
In the example above, we’ve zoomed out as far as the Optimal RSI Bollinger Bands go. You’ll notice, the Bollinger Bands may act as Support and Resistance locations within and outside of the RSI Mid zone (30-70). In the next example we will highlight these areas so they may be easier to see.
  
Circled above, you may see how many times the Optimal RSI faced Support and Resistance locations on the Bollinger Bands. These Bollinger Bands may give a second location for Support and Resistance. The key Support and Resistance may still be the 30/50/70, however the Bollinger Bands allows us to have a more adaptive, moving form of Support and Resistance. This helps to show where it may ‘bounce’ if it surpasses any of the static levels (30/50/70).
  
Due to the fact that this Indicator may take a long time to execute and it can throw errors for such, we have added a Setting called: Adjust Optimal RSI Lookback and RSI Count. This settings will automatically modify the Optimal RSI Lookback Length and the RSI Count based on the Time Frame you are on and the Bar Indexes that are within. For instance, if we switch to the 1 Hour Time Frame, it will adjust the length from 200->90 and RSI Count from 30->20. If this wasn’t adjusted, the Indicator would Timeout.
You may however, change the Setting ‘Adjust Optimal RSI Lookback and RSI Count’ to ‘Manual’ from ‘Auto’. This will give you control over the ‘Optimal RSI Lookback Length’ and ‘RSI Count’ within the Settings. Please note, it will likely take some “fine tuning” to find working settings without the Indicator timing out, but there are definitely times you can find better settings than our ‘Auto’ will create; especially on higher Time Frames. The Minimum our ‘Auto’ will create is:
 
 Optimal RSI Lookback Length: 90
 RSI Count: 20
 
The Maximum it will create is:
 
 Optimal RSI Lookback Length: 200
 RSI Count: 30
 
If there isn’t much bar index history, for instance, if you’re on the 1 Day and the pair is BTC/USDT you’ll get < 4000 Bar Indexes worth of data. For this reason it is possible to manually increase the settings to say:
 
 Optimal RSI Lookback Length: 500
 RSI Count: 50
 
But, please note, if you make it too high, it may also lead to inaccuracies. 
We will conclude our Tutorial here, hopefully this has given you some insight as to how calculating our Optimal RSI and then using it within Machine Learning may create a more adaptive RSI.
 Settings: 
Optimal RSI:
 
 Show Crossing Signals: Display signals where the RSI and RSI Cross.
 Show Tables: Display Information Tables to show information like, Optimal RSI Length, Best Profit, New Optimal RSI Lookback Length and New RSI Count.
 Show Bollinger Bands: Show RSI Bollinger Bands. These bands work like the TDI Indicator, except its length changes as it uses the current RSI Optimal Length.
 Optimal RSI Type: This is how we calculate our Optimal RSI. Do we use all RSI and RSI MA Crossings or just when it crosses within the Extremities.
 Adjust Optimal RSI Lookback and RSI Count: Auto means the script will automatically adjust the Optimal RSI Lookback Length and RSI Count based on the current Time Frame and Bar Index's on chart. This will attempt to stop the script from 'Taking too long to Execute'. Manual means you have full control of the Optimal RSI Lookback Length and RSI Count.
 Optimal RSI Lookback Length: How far back are we looking to see which RSI length is optimal? Please note the more bars the lower this needs to be. For instance with BTC/USDT you can use 500 here on 1D but only 200 for 15 Minutes; otherwise it will timeout.
 RSI Count: How many lengths are we checking? For instance, if our 'RSI Minimum Length' is 4 and this is 30, the valid RSI lengths we check is 4-34.
 RSI Minimum Length: What is the RSI length we start our scans at? We are capped with RSI Count otherwise it will cause the Indicator to timeout, so we don't want to waste any processing power on irrelevant lengths.
 RSI MA Length: What length are we using to calculate the optimal RSI cross' and likewise plot our RSI MA with?
 Extremity Crossings RSI Backup Length: When there is no Optimal RSI (if using Extremity Crossings), which RSI should we use instead?
 
Machine Learning:
 
 Use Rational Quadratics: Rationalizing our Close may be beneficial for usage within ML calculations.
 Filter RSI and RSI MA: Should we filter the RSI's before usage in ML calculations? Essentially should we only use RSI data that are of the same type as our Optimal RSI? For instance if our Optimal RSI is Bullish (RSI > RSI MA), should we only use ML RSI's that are likewise bullish?
 Machine Learning Type: Are we using a Simple ML Average, KNN Mean Average, KNN Exponential Average or None?
 KNN Distance Type: We need to check if distance is within the KNN Min/Max distance, which distance checks are we using.
 Machine Learning Length: How far back is our Machine Learning going to keep data for.
 k-Nearest Neighbour (KNN) Length: How many k-Nearest Neighbours will we account for?
 Fast ML Data Length: What is our Fast ML Length? This is used with our Slow Length to create our KNN Distance.
 Slow ML Data Length: What is our Slow ML Length? This is used with our Fast Length to create our KNN Distance.
 
If you have any questions, comments, ideas or concerns please don't hesitate to contact us.
HAPPY TRADING!
SUPERTREND MIXED ICHI-DMI-DONCHIAN-VOL-GAP-HLBox@RLSUPERTREND MIXED ICHI-DMI-VOL-GAP-HLBox@RL 
by RegisL76
This script is based on several trend indicators. 
* ICHIMOKU (KINKO HYO) 
* DMI (Directional Movement Index) 
* SUPERTREND ICHIMOKU + SUPERTREND DMI 
* DONCHIAN CANAL Optimized with Colored Bars 
* HMA Hull 
* Fair Value GAP 
* VOLUME/ MA Volume 
* PRICE / MA Price 
* HHLL BOXES 
All these indications are visible simultaneously on a single graph. A data table summarizes all the important information to make a good trade decision.
ICHIMOKU Indicator: 
The ICHIMOKU indicator is visualized in the traditional way.
 ICHIMOKU standard setting values are respected but modifiable. (Traditional defaults =  . 
An oriented visual symbol, near the last value, indicates the progression (Ascending, Descending or neutral) of the TENKAN-SEN and the KIJUN-SEN as well as the period used. 
The CLOUD (KUMO) and the CHIKOU-SPAN are present and are essential for the complete analysis of the ICHIMOKU. 
At the top of the graph are visually represented the crossings of the TENKAN and the KIJUN. 
Vertical lines, accompanied by labels, make it possible to quickly visualize the particularities of the ICHIMOKU. 
A line displays the current bar. 
A line visualizes the end of the CLOUD (KUMO) which is shifted 25 bars into the future. 
A line visualizes the end of the chikou-span, which is shifted 25 bars in the past. 
DIRECTIONAL MOVEMENT INDEX (DMI) :  Treated conventionally : DI+, DI-, ADX and associated with a SUPERTREND DMI. 
A visual symbol at the bottom of the graph indicates DI+ and DI- crossings 
A line of oriented and colored symbols (DMI Line) at the top of the chart indicates the direction and strength of the trend.
SUPERTREND ICHIMOKU + SUPERTREND DMI : 
Trend following by SUPERTREND calculation. 
DONCHIAN CHANNEL: Treated conventionally. (And optimized by colored bars when overshooting either up or down.
The lines, high and low of the last values of the channel are represented to quickly visualize the level of the RANGE. 
SUPERTREND HMA (HULL) Treated conventionally. 
The HMA line visually indicates, according to color and direction, the market trend. 
A visual symbol at the bottom of the chart indicates opportunities to sell and buy. 
VOLUME: 
Calculation of the MOBILE AVERAGE of the volume with comparison of the volume compared to the moving average of the volume. 
The indications are colored and commented according to the comparison. 
PRICE: Calculation of the MOBILE AVERAGE of the price with comparison of the price compared to the moving average of the price. 
The indications are colored and commented according to the comparison. 
HHLL BOXES: 
Visualizes in the form of a box, for a given period, the max high and min low values of the price. 
The configuration allows taking into account the high and low wicks of the price or the opening and closing values. 
FAIR VALUE GAP : 
This indicator displays 'GAP' levels over the current time period and an optional higher time period. 
The script takes into account the high/low values of the current bar and compares with the 2 previous bars. 
The "gap" is generated from the lack of overlap between these bars. Bearish or bullish gaps are determined by whether the gap is above or below HmaPrice, as they tend to fill, and can be used as targets. 
NOTE: FAIR VALUE GAP has no values displayed in the table and/or label. 
Important information (DATA) relating to each indicator is displayed in real time in a table and/or a label.
 Each information is commented and colored according to direction, value, comparison etc. 
Each piece of information indicates the values of the current bar and the previous value (in "FULL" mode). 
The other possible modes for viewing the table and/or the label allow a more synthetic view of the information ("CONDENSED" and "MINIMAL" modes). 
In order not to overload the vision of the chart too much, the visualization box of the RANGE DONCHIAN, the vertical lines of the shifted marks of the ICHIMOKU, as well as the boxes of the HHLL Boxes indicator are only visualized intermittently (managed by an adjustable time delay  ). 
The "HISTORICAL INFO READING" configuration parameter set to zero (by default) makes it possible to read all the information of the current bar in progress (Bar #0). All other values allow to read the information of a historical bar. The value 1 reads the information of the bar preceding the current bar (-1). The value 10 makes it possible to read the information of the tenth bar behind (-10) compared to the current bar, etc. 
At the bottom of the DATAS table and label, lights, red, green or white indicate quickly summarize the trend from the various indicators. 
Each light represents the number of indicators with the same trend at a given time. 
Green for a bullish trend, red for a bearish trend and white for a neutral trend. 
The conditions for determining a trend are for each indicator: 
SUPERTREND  ICHIMOHU + DMI: the 2 Super trends together are either bullish or bearish. 
Otherwise the signal is neutral. 
DMI: 2 main conditions: 
BULLISH if DI+ >= DI- and ADX >25. 
BEARISH if DI+ < DI- and ADX >25. 
NEUTRAL if the 2 conditions are not met.
ICHIMOKU: 3 main conditions: 
BULLISH if PRICE above the cloud and TENKAN > KIJUN and GREEN CLOUD AHEAD. 
BEARISH if PRICE below the cloud and TENKAN < KIJUN and RED CLOUD AHEAD. 
The other additional conditions (Data) complete the analysis and are present for informational purposes of the trend and depend on the context. 
DONCHIAN CHANNEL: 1 main condition: 
BULLISH: the price has crossed above the HIGH DC line. 
BEARISH: the price has gone below the LOW DC line. 
NEUTRAL if the price is between the HIGH DC and LOW DC lines 
The 2 other complementary conditions (Datas) complete the analysis: 
HIGH DC and LOW DC are increasing, falling or stable. 
SUPERTREND HMA HULL: The script determines several trend levels: 
STRONG BUY, BUY, STRONG SELL, SELL AND NEUTRAL. 
VOLUME: 3 trend levels: 
VOLUME > MOVING AVERAGE, 
VOLUME < MOVING AVERAGE, 
VOLUME = MOVING AVERAGE. 
PRICE: 3 trend levels: 
PRICE > MOVING AVERAGE, 
PRICE < MOVING AVERAGE, 
PRICE = MOVING AVERAGE. 
If you are using this indicator/strategy and you are satisfied with the results, you can possibly make a donation (a coffee, a pizza or more...) via paypal to: lebourg.regis@free.fr. 
Thanks in advance !!! 
Have good winning Trades.
**************************************************************************************************************************
SUPERTREND MIXED ICHI-DMI-VOL-GAP-HLBox@RL
by RegisL76
Ce script est basé sur plusieurs indicateurs de tendance.
* ICHIMOKU (KINKO HYO)
* DMI (Directional Movement Index)
* SUPERTREND ICHIMOKU +  SUPERTREND DMI
* DONCHIAN CANAL Optimized with Colored Bars
* HMA Hull
* Fair Value GAP
* VOLUME/ MA Volume
* PRIX / MA Prix
* HHLL BOXES
Toutes ces indications sont visibles simultanément sur un seul et même graphique.
Un tableau de données récapitule toutes les informations importantes pour prendre une bonne décision de Trade.
I- Indicateur ICHIMOKU : 
L’indicateur ICHIMOKU est visualisé de manière traditionnelle
Les valeurs de réglage standard ICHIMOKU sont respectées mais modifiables. (Valeurs traditionnelles par défaut =  
Un symbole visuel orienté, à proximité de la dernière valeur, indique la progression (Montant, Descendant ou neutre) de la TENKAN-SEN et de la KIJUN-SEN ainsi que la période utilisée. 
Le NUAGE (KUMO) et la CHIKOU-SPAN sont bien présents et sont primordiaux pour l'analyse complète de l'ICHIMOKU.
En haut du graphique sont représentés visuellement les croisements de la TENKAN et de la KIJUN.
Des lignes verticales, accompagnées d'étiquettes, permettent de visualiser rapidement les particularités de l'ICHIMOKU.
Une ligne visualise la barre en cours.
Une ligne visualise l'extrémité du NUAGE (KUMO) qui est décalé de 25 barres dans le futur.
Une ligne visualise l'extrémité de la chikou-span, qui est décalée de 25 barres dans le passé.
II-DIRECTIONAL MOVEMENT INDEX (DMI)
Traité de manière conventionnelle : DI+, DI-, ADX et associé à un SUPERTREND DMI
Un symbole visuel en bas du graphique indique les croisements DI+ et DI-
Une ligne de symboles orientés et colorés (DMI Line) en haut du graphique, indique la direction et la puissance de la tendance.
III SUPERTREND ICHIMOKU + SUPERTREND DMI
Suivi de tendance par calcul SUPERTREND
IV- DONCHIAN CANAL : 
Traité de manière conventionnelle.
(Et optimisé par des barres colorées en cas de dépassement soit vers le haut, soit vers le bas.
Les lignes, haute et basse des dernières valeurs du canal sont représentées pour visualiser rapidement la fourchette du RANGE. 
V- SUPERTREND HMA (HULL)
Traité de manière conventionnelle.
La ligne HMA indique visuellement, selon la couleur et l'orientation, la tendance du marché.
Un symbole visuel en bas du graphique indique les opportunités de vente et d'achat.
*VI VOLUME : 
Calcul de la MOYENNE MOBILE du volume avec comparaison du volume par rapport à la moyenne mobile du volume.
Les indications sont colorées et commentées en fonction de la comparaison.
*VII PRIX : 
Calcul de la MOYENNE MOBILE du prix avec comparaison du prix par rapport à la moyenne mobile du prix.
Les indications sont colorées et commentées en fonction de la comparaison.
*VIII HHLL BOXES : 
Visualise sous forme de boite, pour une période donnée, les valeurs max hautes et min basses du prix.
La configuration permet de prendre en compte les mèches hautes et basses du prix ou bien les valeurs d'ouverture et de fermeture.
IX - FAIR VALUE GAP
Cet indicateur affiche les niveaux de 'GAP' sur la période temporelle actuelle ET une période temporelle facultative supérieure.
Le script prend en compte les valeurs haut/bas de la barre actuelle  et compare avec les 2 barres précédentes.
Le "gap" est généré à partir du manque de recouvrement entre ces barres.
Les écarts baissiers ou haussiers sont déterminés selon que l'écart est supérieurs ou inférieur à HmaPrice, car ils ont tendance à être comblés, et peuvent être utilisés comme cibles.
NOTA : FAIR VALUE GAP n'a pas de valeurs affichées dans la table et/ou l'étiquette.
Les informations importantes (DATAS) relatives à chaque indicateur sont visualisées en temps réel dans une table et/ou une étiquette.
Chaque information est commentée et colorée en fonction de la direction, de la valeur, de la comparaison etc.
Chaque information indique la valeurs de la barre en cours et la valeur précédente ( en mode "COMPLET").
Les autres modes possibles pour visualiser la table et/ou l'étiquette, permettent une vue plus synthétique des informations (modes "CONDENSÉ" et "MINIMAL").
Afin de ne pas trop surcharger la vision du graphique, la boite de visualisation du RANGE DONCHIAN, les lignes verticales des marques décalées de l'ICHIMOKU, ainsi que les boites de l'indicateur HHLL Boxes ne sont visualisées que de manière intermittente (géré par une temporisation réglable  ).
Le paramètre de configuration "HISTORICAL INFO READING" réglé sur zéro (par défaut) permet de lire toutes les informations de la barre actuelle en cours (Barre #0).
Toutes autres valeurs permet de lire les informations d'une barre historique. La valeur 1 permet de lire les informations de la barre précédant la barre en cours (-1).
La valeur 10 permet de lire les information de la dixième barre en arrière (-10) par rapport à la barre en cours, etc.
Dans le bas de la table et de l'étiquette de DATAS, des voyants, rouge, vert ou blanc indique de manière rapide la synthèse de la tendance issue des différents indicateurs.
Chaque voyant représente le nombre d'indicateur ayant la même tendance à un instant donné. Vert pour une tendance Bullish, rouge pour une tendance Bearish et blanc pour une tendance neutre.
Les conditions pour déterminer une tendance sont pour chaque indicateur :
SUPERTREND ICHIMOHU + DMI : les 2 Super trends sont ensemble soit bullish soit Bearish. Sinon le signal est neutre.
DMI : 2 conditions principales : 
BULLISH si DI+ >= DI- et ADX >25.
BEARISH si DI+ <  DI- et ADX >25.
NEUTRE si les 2 conditions ne sont pas remplies.
ICHIMOKU : 3 conditions principales :
BULLISH si PRIX au dessus du nuage  et TENKAN > KIJUN et NUAGE VERT DEVANT.
BEARISH si PRIX en dessous du nuage et TENKAN < KIJUN et NUAGE ROUGE DEVANT.
Les autres conditions complémentaires (Datas) complètent l'analyse et sont présents à titre informatif de la tendance et dépendent du contexte.
CANAL DONCHIAN : 1 condition principale : 
BULLISH : le prix est passé au dessus de la ligne HIGH DC.
BEARISH : le prix est passé au dessous de la ligne LOW DC.
NEUTRE si le prix se situe entre les lignes  HIGH DC et LOW DC
Les 2 autres conditions complémentaires (Datas) complètent l'analyse : HIGH DC  et LOW DC sont croissants, descendants ou stables.
SUPERTREND HMA HULL : 
Le script détermine plusieurs niveaux de tendance :
STRONG BUY, BUY, STRONG SELL, SELL ET NEUTRE.
VOLUME : 3 niveaux de tendance : 
VOLUME > MOYENNE MOBILE, VOLUME < MOYENNE MOBILE, VOLUME = MOYENNE MOBILE.
PRIX : 3 niveaux de tendance : 
PRIX > MOYENNE MOBILE, PRIX < MOYENNE MOBILE, PRIX = MOYENNE MOBILE.
Si vous utilisez cet indicateur/ stratégie et que vous êtes satisfait des résultats, 
 vous pouvez éventuellement me faire un don (un café, une pizza ou plus ...) via paypal à : lebourg.regis@free.fr.
 Merci d'avance !!!
Ayez de bons Trades gagnants.
Tchwella Stocks Custom WatermarkThis Pine Script v5 indicator adds a customizable watermark to TradingView charts, displaying key stock information while allowing for flexible positioning and formatting.
📌 Features & Functionality:
✅ Custom Positioning:
• Fixed to the top-left corner.
• Adjustable spacing ensures the text is properly aligned.
✅ Displayed Information (Configurable):
• Company Name & Market Cap (Optional: Shows dynamically calculated market cap)
• Stock Ticker & Timeframe
• Industry & Sector
✅ Customization Options:
• Font Size: Huge, Large, Normal, Small
• Text Color & Transparency: Adjustable
• Proper Left Alignment for a clean, structured display
• Vertical Offset Tweaks to move text down for better visibility
✅ Optimized Table Layout:
• Uses table.new() for persistent placement.
• Added an empty row to fine-tune positioning, ensuring the watermark doesn’t overlap key chart areas.
🔧 Use Case:
Designed for traders who want a clear, customizable stock watermark to enhance their charting experience without obstructing price action.
Feb 1
Release Notes
Updated version: now you can decide your location for the watermark
Micha Stocks Custom Watermark (MSWM) – TradingView Script
This Pine Script v5 indicator adds a customizable watermark to TradingView charts, displaying key stock information while allowing for flexible positioning and formatting.
📌 Features & Functionality:
✅ Custom Positioning:
• Fixed to the top-left corner.
• Adjustable spacing ensures the text is properly aligned.
✅ Displayed Information (Configurable):
• Company Name & Market Cap (Optional: Shows dynamically calculated market cap)
• Stock Ticker & Timeframe
• Industry & Sector
✅ Customization Options:
• Font Size: Huge, Large, Normal, Small
• Text Color & Transparency: Adjustable
• Proper Left Alignment for a clean, structured display
• Vertical Offset Tweaks to move text down for better visibility
✅ Optimized Table Layout:
• Uses table.new() for persistent placement.
• Added an empty row to fine-tune positioning, ensuring the watermark doesn’t overlap key chart areas.
🔧 Use Case:
Designed for traders who want a clear, customizable stock watermark to enhance their charting experience without obstructing price action.
Feb 7
Release Notes
Micha Stocks Custom Watermark – Updated Version 🚀
This updated Micha Stocks Custom Watermark script enhances your TradingView experience by adding an ATR-based volatility signal alongside the existing customizable stock watermark.
🆕 New Features & Improvements:
✅ ATR (14-Day) with Dynamic Volatility Indicator
• Displays the ATR value and its percentage relative to price.
• Includes a color-coded volatility signal:
• 🔴 High Volatility (Above user-defined Red Threshold)
• 🟡 Moderate Volatility (Between Red & Yellow Thresholds)
• 🟢 Low Volatility (Below user-defined Yellow Threshold)
✅ Fully Customizable ATR Thresholds
• Users can set their own ATR % levels for Red, Yellow, and Green signals.
✅ Improved Watermark Customization
• Users can still adjust the position, size, and color of the watermark.
• Includes Company Name, Ticker, Market Cap, Industry, and Sector.
• ATR can be turned on/off in settings for flexibility.
🔧 How to Use:
1️⃣ Go to Indicator Settings → Enable or Disable ATR Display
2️⃣ Adjust ATR % Thresholds to fit your volatility preference
3️⃣ Customize Text Position, Color, and Size to match your chart setup
This update makes it easier to quickly assess market volatility while keeping a clean and professional chart layout.
💡 Why Use This Indicator?
• Effortlessly track key stock info without cluttering your chart.
• Quickly identify volatile conditions using ATR percentage signals.
• Adjust settings on the fly to match your trading strategy.
📢 Update Now & Enjoy a Smarter Charting Experience!
Buyer vs Seller ControlBuyer vs Seller Control Analysis 
 Technical indicator measuring market participation through candlestick wick analysis 
 Overview: 
This indicator analyzes the relationship between closing prices and candlestick wicks to measure buying and selling pressure. It calculates two key metrics and displays their moving averages to help identify market sentiment shifts.
 Calculation Method: 
The indicator measures two distinct values for each candle:
 
 Buyer Control Value:  Distance from candle low to closing price  (close - low) 
 Seller Control Value:  Distance from candle high to closing price  (high - close) 
 
Both values are then smoothed using a Simple Moving Average (default period: 20) to reduce noise and show clearer trends.
 Visual Components: 
 
 Lime Line:  20-period SMA of buyer control values
 Fuchsia Line:  20-period SMA of seller control values
 Area Fill:  Colored region between the two lines
 Histogram:  Difference between buyer and seller control SMAs
 Zero Reference Line:  Horizontal line at zero level
 Information Table:  Current numerical values (optional display)
 
 Interpretation: 
 
When the lime line (buyer control) is above the fuchsia line (seller control), it indicates that recent candles have been closing closer to their highs than to their lows on average.
When the fuchsia line is above the lime line, recent candles have been closing closer to their lows than to their highs on average.
 
 Fill Color Logic: 
 
 Lime (green) fill appears when buyer control SMA > seller control SMA
 Fuchsia (red) fill appears when seller control SMA > buyer control SMA  
 Fill transparency adjusts based on the magnitude of difference between the two SMAs
 Stronger differences result in more opaque fills
 
 Settings: 
 
 Moving Average Period:  Adjustable from 1-200 periods (default: 20)
 Show Info Table:  Toggle to display/hide the numerical values table
 
 Technical Notes: 
 
 The indicator works on any timeframe
 Values are displayed in the same units as the underlying asset's price
 The histogram shows the mathematical difference between the two SMA lines
 Transparency calculation uses a 50-period lookback for dynamic scaling
 
 This indicator provides a quantitative approach to analyzing candlestick patterns by focusing on where prices close relative to their intraday ranges.
Extended CANSLIM Indicator❖ Extended CANSLIM Indicator. 
The Extended CANSLIM indicator is an indicator that concentrates all the tools usually used by CANSLIM traders.
It shows a table where all the stock fundamental information is shown at once first for the last quarter and then up to 5 years back.
The fundamental data is checked against well known CANSLIM validation criteria and is shown over 4 state levels.
1. Good = Value is CANSLIM Compliant.
2. Acceptable = Value is not CANSLIM compliant but still good. value is shown with a lighter background color.
3. Warning = Value deserves special attention. Value is shown over orange background color.
3. Stop = Value is non CANSLIM compliant or indicates a stop trading condition. Value is shown over red background color.
The indicator has also a set of technical tools calculated on price or index and shown directly on the chart.
 ❖ Fundamental data shown in the table. 
The table is arranged in 4 sets of data:
1. Table Header, showing Indicator and Company data.
2. CANSLIM.
3. 3Rs: RS Rating, Revenue and ROE.
4. Extra Data: Piotroski score, ATR, Trend Days, D to E, Avg Vol and Vol today.
Sets 3 and 4 can be hidden from the table.
 ❖ Indicator and Compay Data. 
The table header shows, Indicator name and version.
It then displays Company Name, sector and industry, human size and its capitalization.
 ❖ CANSLIM Data. 
Displays either genuine CANSLIM data from TradinView or custom data as best effort when that data cannot be obtained in TV.
C = EPS diluted growth, Quarterly YoY.
      	 >= 25% = Good, >= 0% = Acceptable, < 0% = Stop 
A = EPS diluted growth, Annual YoY.
      	 >= 25% = Good, >= 0% = Acceptable, < 0% = Stop 
N = New High as best effort (Cust).
      	 Always Good 
S = Float shares as best effort.
      	 Always Good 
L = One year performance relative to S&P 500 (Cust),
      	 Positive : 0% .. 50% = Neutral, 50%+ = Leader, 80%+ = Leader+, 100%+ = Leader++
      	Negative : 0% .. -10% = Laggard, -10% .. -30% = Laggard+, -30%+ = Laggard++
	>= 50% = Good, >= 0% = Acceptable, >= -10% Warning, < -10% = Stop 
I = Accumulation/Distribution days over last 25 days as a clue for institutional support (Cust).
      	 A delta is calculated by subtracting Distribution to Accumulation days.
      	> 0 = Good, = 0 = Acceptable, < 0 = Warning, < -5 = Stop 
M = Market direction and exposure measured on S&500 closing between averages (Cust).
      	 Varies from 0% Full Bear to 100% Full Bull
      	>= 80% = Good, >= 60% = Acceptable, >= 40% = Warning, < 40% = Stop 
 ❖ Extra non CANSLIM Data. 
RS = RS Rating.
	 >= 90 = Good, >= 80 = Accept, >= 50 = Warning, < 50 = Stop 
Rev. = Revenue Growth Quarterly YoY.
      	 >= 0% = Good, <0% = Stop 
ROE = Return on Equity, Quarterly YoY.
      	 >= 17% = Good, >= 0% = Acceptable, < 0% = Stop 
Piotr. = Piotroski Score, www.investopedia.com (TV)
      	 >= 7 = Good, >= 4 = Acceptable, < 4 = Stop 
ATR = Average True Range over the last 20 days (Cust).
      	 0% - 2% = Acceptable, 2% - 4% = Ideal, 4% - 6% = Warning, 5%+ = Stop. 
Trend Days = Days since EMA150 is over EMA200 (Cust).
      	 Always Good 
D. to E. = Days left before Earnings. Maybe not a good idea buying just before earnings (Cust).
      	 >= 28 = Good, >= 21 = Acceptable, >= 14 = Warning, < 14 = Stop 
Avg Vol. = 50d Average Volume (Cust).
      	 >= 100K = Good, < 100K = Acceptable 
Vol. Today = Today's percentage volume compared to 50d average (Cust).
      	 Always Good. 
 ❖ Historical Data. 
Optionally selectable historical data can be displayed for C, A, Revenue and ROE up to 20 quarters if available.
Quarterly numbers can also be displayed for A, C and Revenue.
Information can be shown in Chronological or Reverse Chronological order (default).
Increasing growth quarters are shown in white, while diminuing ones are shown in Yellow.
Transition from Losing to Profitable quarters are shown with an exclamation mark ‘!’
Finally, losing quarters are shown between parenthesis.
 ❖ MAs on chart. 
Displays 200, 100, 50 and 20 days MAs on chart.
The MAs are also automatically scaled in the 1W time frame.
 ❖ New 52 Week High on chart. 
A sun is shown on the chart the first time that a new 52 week high is reached.
The N cell shows a filled sun when a 52 week high is no older than a month, an lighter sun when it’s no older than a quarter or a moon otherwise.
 ❖ Pocket Pivots on chart. 
Small triangles below the price are signaling pocket pivots.
 ❖ Bases on chart, formerly Darvas Boxes. 
Draw bases as defined by Darvas boxes, both top or bottom of bases can be selected to be shown in order to only show resistance or support.
 ❖ Market exposure/direction indicator. 
When charting S&P500 (SPX), Nasdaq 100 Index (NDX), Nasdaq composite (IXIC) or Dow Jownes Index (DJIA), the indicator switches to Market Exposure indicator, showing also Accumulation/Distribution days when volume information is available. This indication which varies from 0% to 100% is what is shown under the M letter in the CANSLIM table which is calculated on the S&P500.
 ❖ Follow Through Days indicator. 
If you are an adept of the Low-cheat entry, then you will be highly interested by the Follow Through days indicator as measured in the S&P 500 and shown as diamonds on the chart.
The follow-through days are calculated on S&P500 but shown in current stock chart so you don’t need to chart the S&P 500 to know that a follow through day occurred.
Follow Through days show correctly on Daily time frame and most are also shown on the Weekly time frame as well.
They are also classified according to the market zone in which they occur:
0%-5% from peak = Pullback : FT day is not shown.
5%-10% from peak = Minor Correction : Minor FT days is shown.
10%-20% from peak = Correction : Intermediate FT days us shown
20+% from peak = Bear Market : Makor FT days is shown
 ❖ RS Line and Rating indicator. 
A RS Line and Rating indicator can be added to the chart.
Relative Strength Rating Accuracy.
Please note that the RS Rating is not 100% accurate when compared to IBD values.
 ❖ Earning Line indicator. 
An Earning Line indicator can be added to the chart.
 ❖ ATR Bands and ATR Trade calculator. 
The motivation for this calculator came from my own need to enter trades on volatile stocks where the simple 7% Stop Loss rule doest not work. 
It simply calculates the number of shares you can buy at any moment based on current stock price and using the lower ATR band as a stop loss.
 A few words about the ATR Bands. 
On this indicator the ATR bands are not drawn as a classical channel that follows the price.
The lower band is drawn as a support until it’s broken on a closing basis. It can’t be in a down trend.
The upper band is drawn as a resistance until it’s broken on a closing basis. It can’t be in an up trend.
The idea is that when price starts to fall down from a peak, it should not violate its lower band ATR and that means that we can use that level as a Stop Loss.
You must look back for the stock volatility and find out which ATR multiplier works well meaning that the ATR bands are not violated on normal pullbacks. By default, the indicator uses 5x multiplier.
 ❖ Extra things, visual features and default settings. 
The first square cell of current quarter displays a check mark ‘V’ if the CANSLIM criteria is OK or acceptable or a cross ‘X’ otherwise.
The first square cell of historical C and Rev show respectively the count of last consecutive positive quarters.
There are different color themes from “Forest” to “Space” you can chose from to best fit your eyes.
You also have different table sizes going from “Micro” to “Huge” for better adjustment to the size of your display.
The default settings view show: Pocket Pivots, FT Days, MA50, RS Line and ATR Bands.
That's all, Enjoy!
MSFA_LibraryLibrary   "MSFA_library" 
TODO: add library description here
 getDecimals() 
  Calculates how many decimals are on the quote price of the current market
  Returns: The current decimal places on the market quote price
 getPipSize(multiplier) 
  Calculates the pip size of the current market
  Parameters:
     multiplier (int) : The mintick point multiplier (1 by default, 10 for FX/Crypto/CFD but can be used to override when certain markets require)
  Returns: The pip size for the current market
 truncate(number, decimalPlaces) 
  Truncates (cuts) excess decimal places
  Parameters:
     number (float) : The number to truncate
     decimalPlaces (simple float) : (default=2) The number of decimal places to truncate to
  Returns: The given number truncated to the given decimalPlaces
 toWhole(number) 
  Converts pips into whole numbers
  Parameters:
     number (float) : The pip number to convert into a whole number
  Returns: The converted number
 toPips(number) 
  Converts whole numbers back into pips
  Parameters:
     number (float) : The whole number to convert into pips
  Returns: The converted number
 getPctChange(value1, value2, lookback) 
  Gets the percentage change between 2 float values over a given lookback period
  Parameters:
     value1 (float) : The first value to reference
     value2 (float) : The second value to reference
     lookback (int) : The lookback period to analyze
  Returns: The percent change over the two values and lookback period
 random(minRange, maxRange) 
  Wichmann–Hill Pseudo-Random Number Generator
  Parameters:
     minRange (float) : The smallest possible number (default: 0)
     maxRange (float) : The largest possible number (default: 1)
  Returns: A random number between minRange and maxRange
 bullFib(priceLow, priceHigh, fibRatio) 
  Calculates a bullish fibonacci value
  Parameters:
     priceLow (float) : The lowest price point
     priceHigh (float) : The highest price point
     fibRatio (float) : The fibonacci % ratio to calculate
  Returns: The fibonacci value of the given ratio between the two price points
 bearFib(priceLow, priceHigh, fibRatio) 
  Calculates a bearish fibonacci value
  Parameters:
     priceLow (float) : The lowest price point
     priceHigh (float) : The highest price point
     fibRatio (float) : The fibonacci % ratio to calculate
  Returns: The fibonacci value of the given ratio between the two price points
 getMA(length, maType) 
  Gets a Moving Average based on type (! MUST BE CALLED ON EVERY TICK TO BE ACCURATE, don't place in scopes)
  Parameters:
     length (simple int) : The MA period
     maType (string) : The type of MA
  Returns: A moving average with the given parameters
 barsAboveMA(lookback, ma) 
  Counts how many candles are above the MA
  Parameters:
     lookback (int) : The lookback period to look back over
     ma (float) : The moving average to check
  Returns: The bar count of how many recent bars are above the MA
 barsBelowMA(lookback, ma) 
  Counts how many candles are below the MA
  Parameters:
     lookback (int) : The lookback period to look back over
     ma (float) : The moving average to reference
  Returns: The bar count of how many recent bars are below the EMA
 barsCrossedMA(lookback, ma) 
  Counts how many times the EMA was crossed recently (based on closing prices)
  Parameters:
     lookback (int) : The lookback period to look back over
     ma (float) : The moving average to reference
  Returns: The bar count of how many times price recently crossed the EMA (based on closing prices)
 getPullbackBarCount(lookback, direction) 
  Counts how many green & red bars have printed recently (ie. pullback count)
  Parameters:
     lookback (int) : The lookback period to look back over
     direction (int) : The color of the bar to count (1 = Green, -1 = Red)
  Returns: The bar count of how many candles have retraced over the given lookback & direction
 getBodySize() 
  Gets the current candle's body size (in POINTS, divide by 10 to get pips)
  Returns: The current candle's body size in POINTS
 getTopWickSize() 
  Gets the current candle's top wick size (in POINTS, divide by 10 to get pips)
  Returns: The current candle's top wick size in POINTS
 getBottomWickSize() 
  Gets the current candle's bottom wick size (in POINTS, divide by 10 to get pips)
  Returns: The current candle's bottom wick size in POINTS
 getBodyPercent() 
  Gets the current candle's body size as a percentage of its entire size including its wicks
  Returns: The current candle's body size percentage
 isHammer(fib, colorMatch) 
  Checks if the current bar is a hammer candle based on the given parameters
  Parameters:
     fib (float) : (default=0.382) The fib to base candle body on
     colorMatch (bool) : (default=false) Does the candle need to be green? (true/false)
  Returns: A boolean - true if the current bar matches the requirements of a hammer candle
 isStar(fib, colorMatch) 
  Checks if the current bar is a shooting star candle based on the given parameters
  Parameters:
     fib (float) : (default=0.382) The fib to base candle body on
     colorMatch (bool) : (default=false) Does the candle need to be red? (true/false)
  Returns: A boolean - true if the current bar matches the requirements of a shooting star candle
 isDoji(wickSize, bodySize) 
  Checks if the current bar is a doji candle based on the given parameters
  Parameters:
     wickSize (float) : (default=2) The maximum top wick size compared to the bottom (and vice versa)
     bodySize (float) : (default=0.05) The maximum body size as a percentage compared to the entire candle size
  Returns: A boolean - true if the current bar matches the requirements of a doji candle
 isBullishEC(allowance, rejectionWickSize, engulfWick) 
  Checks if the current bar is a bullish engulfing candle
  Parameters:
     allowance (float) : (default=0) How many POINTS to allow the open to be off by (useful for markets with micro gaps)
     rejectionWickSize (float) : (default=disabled) The maximum rejection wick size compared to the body as a percentage
     engulfWick (bool) : (default=false) Does the engulfing candle require the wick to be engulfed as well?
  Returns: A boolean - true if the current bar matches the requirements of a bullish engulfing candle
 isBearishEC(allowance, rejectionWickSize, engulfWick) 
  Checks if the current bar is a bearish engulfing candle
  Parameters:
     allowance (float) : (default=0) How many POINTS to allow the open to be off by (useful for markets with micro gaps)
     rejectionWickSize (float) : (default=disabled) The maximum rejection wick size compared to the body as a percentage
     engulfWick (bool) : (default=false) Does the engulfing candle require the wick to be engulfed as well?
  Returns: A boolean - true if the current bar matches the requirements of a bearish engulfing candle
 isInsideBar() 
  Detects inside bars
  Returns: Returns true if the current bar is an inside bar
 isOutsideBar() 
  Detects outside bars
  Returns: Returns true if the current bar is an outside bar
 barInSession(sess, useFilter) 
  Determines if the current price bar falls inside the specified session
  Parameters:
     sess (simple string) : The session to check
     useFilter (bool) : (default=true) Whether or not to actually use this filter
  Returns: A boolean - true if the current bar falls within the given time session
 barOutSession(sess, useFilter) 
  Determines if the current price bar falls outside the specified session
  Parameters:
     sess (simple string) : The session to check
     useFilter (bool) : (default=true) Whether or not to actually use this filter
  Returns: A boolean - true if the current bar falls outside the given time session
 dateFilter(startTime, endTime) 
  Determines if this bar's time falls within date filter range
  Parameters:
     startTime (int) : The UNIX date timestamp to begin searching from
     endTime (int) : the UNIX date timestamp to stop searching from
  Returns: A boolean - true if the current bar falls within the given dates
 dayFilter(monday, tuesday, wednesday, thursday, friday, saturday, sunday) 
  Checks if the current bar's day is in the list of given days to analyze
  Parameters:
     monday (bool) : Should the script analyze this day? (true/false)
     tuesday (bool) : Should the script analyze this day? (true/false)
     wednesday (bool) : Should the script analyze this day? (true/false)
     thursday (bool) : Should the script analyze this day? (true/false)
     friday (bool) : Should the script analyze this day? (true/false)
     saturday (bool) : Should the script analyze this day? (true/false)
     sunday (bool) : Should the script analyze this day? (true/false)
  Returns: A boolean - true if the current bar's day is one of the given days
 atrFilter(atrValue, maxSize) 
  Parameters:
     atrValue (float) 
     maxSize (float) 
 tradeCount() 
  Calculate total trade count
  Returns: Total closed trade count
 isLong() 
  Check if we're currently in a long trade
  Returns: True if our position size is positive
 isShort() 
  Check if we're currently in a short trade
  Returns: True if our position size is negative
 isFlat() 
  Check if we're currentlyflat
  Returns: True if our position size is zero
 wonTrade() 
  Check if this bar falls after a winning trade
  Returns: True if we just won a trade
 lostTrade() 
  Check if this bar falls after a losing trade
  Returns: True if we just lost a trade
 maxDrawdownRealized() 
  Gets the max drawdown based on closed trades (ie. realized P&L). The strategy tester displays max drawdown as open P&L (unrealized).
  Returns: The max drawdown based on closed trades (ie. realized P&L). The strategy tester displays max drawdown as open P&L (unrealized).
 totalPipReturn() 
  Gets the total amount of pips won/lost (as a whole number)
  Returns: Total amount of pips won/lost (as a whole number)
 longWinCount() 
  Count how many winning long trades we've had
  Returns: Long win count
 shortWinCount() 
  Count how many winning short trades we've had
  Returns: Short win count
 longLossCount() 
  Count how many losing long trades we've had
  Returns: Long loss count
 shortLossCount() 
  Count how many losing short trades we've had
  Returns: Short loss count
 breakEvenCount(allowanceTicks) 
  Count how many break-even trades we've had
  Parameters:
     allowanceTicks (float) : Optional - how many ticks to allow between entry & exit price (default 0)
  Returns: Break-even count
 longCount() 
  Count how many long trades we've taken
  Returns: Long trade count
 shortCount() 
  Count how many short trades we've taken
  Returns: Short trade count
 longWinPercent() 
  Calculate win rate of long trades
  Returns: Long win rate (0-100)
 shortWinPercent() 
  Calculate win rate of short trades
  Returns: Short win rate (0-100)
 breakEvenPercent(allowanceTicks) 
  Calculate break even rate of all trades
  Parameters:
     allowanceTicks (float) : Optional - how many ticks to allow between entry & exit price (default 0)
  Returns: Break-even win rate (0-100)
 averageRR() 
  Calculate average risk:reward
  Returns: Average winning trade divided by average losing trade
 unitsToLots(units) 
  (Forex) Convert the given unit count to lots (multiples of 100,000)
  Parameters:
     units (float) : The units to convert into lots
  Returns: Units converted to nearest lot size (as float)
 skipTradeMonteCarlo(chance, debug) 
  Checks to see if trade should be skipped to emulate rudimentary Monte Carlo simulation
  Parameters:
     chance (float) : The chance to skip a trade (0-1 or 0-100, function will normalize to 0-1)
     debug (bool) : Whether or not to display a label informing of the trade skip
  Returns: True if the trade is skipped, false if it's not skipped (idea being to include this function in entry condition validation checks)
 fillCell(tableID, column, row, title, value, bgcolor, txtcolor, tooltip) 
  This updates the given table's cell with the given values
  Parameters:
     tableID (table) : The table ID to update
     column (int) : The column to update
     row (int) : The row to update
     title (string) : The title of this cell
     value (string) : The value of this cell
     bgcolor (color) : The background color of this cell
     txtcolor (color) : The text color of this cell
     tooltip (string) 
  Returns: Nothing.
Overheat Oscillator with DivergenceIndicator Description
The Overheat Oscillator with Divergence is an advanced technical indicator designed for the TradingView platform, assisting traders in identifying potential market reversal points by analyzing price momentum and volume, as well as detecting divergences. The indicator combines trend strength assessment with signal smoothing to provide clear indications of market overheat or oversold conditions. An optional divergence detection feature allows for the identification of discrepancies between price movement and the oscillator's value, which may signal upcoming trend changes.
The indicator is displayed in a separate panel below the price chart and offers visual cues through a color gradient, horizontal reference lines, and a dynamic market sentiment table. Users can customize numerous parameters, such as calculation periods, sentiment thresholds, line colors, and visualization styles, making the indicator a versatile tool for various trading strategies.
How the Indicator Works
The indicator is based on the following key components:
Oscillator Calculations
The indicator analyzes price candles, assigning a score based on their nature. A bullish candle (when the closing price is higher than the opening price) receives a score of +1.0, while a bearish candle (when the closing price is lower than the opening price) receives a score of -1.0. This scoring reflects the strength of price movement over a given period.
The score is modified by a volume multiplier (default: 2.0) if the candle's volume exceeds the volume's simple moving average (SMA, default: calculated over 20 candles). This ensures that candles with higher volume have a greater impact on the oscillator's value, better capturing significant market movements driven by increased trading activity. For example, a bullish candle with high volume may receive a score of +2.0 instead of +1.0, amplifying the bullish signal.
The scores are summed over a specified number of candles (default: 20), normalized to a 0–100 range, and then smoothed using a simple moving average (SMA, default: 5 periods) to reduce noise and improve signal clarity.
Color Gradient
The oscillator's values are visualized using a color gradient that changes based on the oscillator's level:
Green: Market cooldown (values below the Gradient Min threshold).
Yellow: Neutral sentiment (values between Gradient Min and Gradient Yellow).
Orange: Elevated activity (values between Gradient Yellow and Gradient Orange).
Red: Market overheat (values above Gradient Orange).
The color gradient is applied as the background in the oscillator panel, facilitating quick assessment of market sentiment.
Reference Levels
The indicator displays customizable horizontal lines for key thresholds (e.g., Overheat Threshold, Oversold Threshold, Gradient Min, Yellow, Orange, Max). These lines are visible only at the height of the last few oscillator candles, preventing chart clutter and helping users focus on current values.
Users can also define three custom horizontal lines with selectable styles (solid, dotted, dashed) and colors. These lines serve as auxiliary tools, e.g., for marking personal support/resistance levels, but do not affect the oscillator's signals or background colors.
Market Sentiment
The indicator displays sentiment labels in a table located in the top-right corner of the panel, dynamically updating based on the oscillator's value:
Cooled: Values below Gradient Yellow (default: 35).
Neutral: Values between Gradient Yellow and Gradient Orange (default: 60).
Excited: Values between Gradient Orange and Overheat Threshold (default: 70).
Overheated: Values above Overheat Threshold (default: 70).
The Overheat Threshold and Oversold Threshold are critical for displaying the "Overheated" and "Cooled" labels in the sentiment table, enabling users to quickly identify extreme market conditions. The labels update when key thresholds are crossed, and their colors match the oscillator's gradient.
Divergence Detection
The indicator offers optional detection of regular bullish and bearish divergences:
Bullish Divergence: Occurs when the price forms a lower low, but the oscillator forms a higher low, suggesting a weakening downtrend.
Bearish Divergence: Occurs when the price forms a higher high, but the oscillator forms a lower high, suggesting a weakening uptrend.
Divergences are marked on the chart with labels ("Bull" for bullish, "Bear" for bearish) and lines indicating pivot points. They are calculated with a delay equal to the Lookback Right setting (default: 5 candles), meaning signals appear after pivot confirmation in the specified lookback period. The indicator also generates alerts for users when a divergence is detected.
Indicator Settings
Main Settings (SETTINGS)
Period Length: Specifies the number of candles used for oscillator calculations (default: 20).
Volume SMA Period: The period for the volume's simple moving average (default: 20).
Volume Multiplier: Multiplier applied to candle scores when volume exceeds the average (default: 2.0).
SMA Length: The period for smoothing the oscillator with a simple moving average (default: 5).
Thresholds (THRESHOLDS)
Overheat Threshold: Level indicating market overheat (default: 70). This value determines when the sentiment table displays the "Overheated" label, signaling a potential peak in an uptrend.
Oversold Threshold: Level indicating market cooldown (default: 30). This value determines when the sentiment table displays the "Cooled" label, signaling a potential bottom in a downtrend.
Gradient Min (Green): Lower threshold for the green gradient (default: 20).
Gradient Yellow Threshold: Threshold for the yellow gradient (default: 35).
Gradient Orange Threshold: Threshold for the orange gradient (default: 60).
Gradient Max (Red): Upper threshold for the red gradient (default: 70).
Visualization (VISUALIZATION)
Signal Line Color: Color of the oscillator line (default: dark red, RGB(5, 0, 0)).
Show Reference Lines: Enables/disables the display of threshold lines (default: enabled).
Divergence Settings (DIVERGENCE SETTINGS)
Calculate Divergence: Enables/disables divergence detection (default: disabled).
Lookback Right: Number of candles back for pivot analysis (default: 5).
Lookback Left: Number of candles to the left for pivot analysis (default: 5).
Line Style (STYLE)
Custom Line 1, 2, 3 Value: Levels for custom horizontal lines (default: 70, 50, 30).
Custom Line 1, 2, 3 Color: Colors for custom lines (default: black, RGB(0, 0, 0)).
Custom Line 1, 2, 3 Style: Line styles (solid, dotted, dashed; default: dashed, dotted, dashed).
How to Use the Indicator
Adding to the Chart
Add the indicator to your TradingView chart by searching for "Overheat Oscillator with Divergence."
Configure the settings according to your trading strategy.
Signal Interpretation
Overheated: Values above the Overheat Threshold (default: 70) in the sentiment table may indicate a potential uptrend peak.
Cooled: Values below the Oversold Threshold (default: 30) in the sentiment table may suggest a potential downtrend bottom.
Divergences:
Bullish: Look for "Bull" labels on the chart, indicating potential upward reversals (calculated with a Lookback Right delay).
Bearish: Look for "Bear" labels, indicating potential downward reversals (calculated with a Lookback Right delay).
Customization
Experiment with settings such as period length, volume multiplier, or gradient thresholds to tailor the indicator to your trading style (e.g., scalping, medium-term trading).
Usage Examples
Scalping: Set a shorter period (e.g., Period Length = 10, SMA Length = 3) and monitor rapid sentiment changes and divergences on lower timeframes (e.g., 5-minute charts).
Medium-Term Trading: Use default settings or increase Period Length (e.g., 30) and SMA Length (e.g., 7) for more stable signals on hourly or daily charts.
Reversal Detection: Enable divergence detection and observe "Bull" or "Bear" labels in conjunction with overheat/cooled levels in the sentiment table.
Notes
The indicator performs best when used in conjunction with other technical analysis tools, such as support/resistance lines, moving averages, or Fibonacci levels.
Divergences may serve as early signals but do not always guarantee immediate trend reversals—confirmation with other indicators is recommended.
Test different settings on historical data to find the optimal configuration for your chosen market and timeframe.






















